SQL – A Quick Overview |¦| SQL Tutorial |¦| SQL for Beginners
- December 24, 2023
- Posted by: MainInstructor
- Category: SQL
Video Title: SQL – A Quick Overview |¦| SQL Tutorial |¦| SQL for Beginners
S..Q..L.. “Structured Query Language”. SQL is a language for handling database CRUD: Create, Read, Update and Delete. With SQL, you can create databases and tables… select specific pieces of data… make changes, remove data, and more. Much, much more… So pour
Yourself a pan galactic gargle blaster, because we are going on a scenic tour of SQL Space. Future users of large data banks must be protected from having to know how the data is organized in the machine… E. F. Codd… This is the opening line from the paper “A
Relational Model of Data for Large Shared Data Banks” In 11 pages Ted Codd laid the foundation for relational databases. A relational database consists of a collection of tables. Each table has a defined set of columns and rows containing data. Each row is called a record. The data between tables can be related to
Each other. This is why they are called “relational” databases. Taken together, the collection of tables in a database is called the schema. So when you are designing a database, you could say that you are … scheming. In the beginning there was nothing. A digital void.
To begin our SQL Tour, let us turn on our server. It is running a database management system – D.B.M.S. for short. First, we connect to the DBMS. Then we create a database. You create a database using the bizarre command “CREATE DATABASE”.
After the command, specify the database name. This will create a database called “social_network.” Because this is precisely what the world needs – another social network… By the way, do not worry about which DBMS is being used. Focus on the SQL… Focus on the SQL… Next, we need to fill this database with some
Tables. To make a table, you use the … wait for it … “CREATE TABLE” command. You specify the name of the table, and then type an open parentheses. Inside you specify the columns this table will have. This table will be called “users” and have 4 columns: user_id… first name… last name… and
Email address. After the name of each column, you enter the datatype. Once we have listed all of the columns, we close the parentheses and enter a semicolon. SQL commands generally end in a semicolon. Execute… This creates a new table called “users”
In our “social_network” database. But wait, what if you are a typical human and forgot a column in the “users” table. You can change an existing table by using the “ALTER TABLE” command. You first specify the table you would like
To change. then enter the “ADD” command. Next, you provide the name and type of the new column. This command will add a new column called “encrypted_password” You do not want to store a user’s password in plain text… As you can hear, I am using my serious voice.
We will hake a serious discussion about the seriousness of security with my serious voice another time. Execute… This SQL command added a new column to our “users” table. If there is a part of a database you no longer want or need, you can cancel its existence with the DROP command.
To eliminate the “email” column, you alter the table and DROP the email column; To delete the “users” table altogether, you execute DROP table users; And to wipe the slate completely clean, you can even drop the database. Here we are.. back to where we started.
Now that you have seen the essentials for creating, altering, and deleting databases, let us visit the various ways you can interact with the data. Suppose we have a database with three tables: users… movies… and purchases… These tables can be created using the CREATE DATABASE and CREATE TABLE commands.
In this diagram, we display the name of the table at the top, and the columns in the table below. You can insert data into the database using the INSERT INTO command. Let us add a record to the “movies” table. You first type “INSERT INTO” followed by the table name.
Next, inside parentheses, specify the columns you will be providing data for. Then the command “VALUES” followed by the corresponding data in parentheses. And do not forget the semicolon. Execute… Our data has been inserted into the movies table. But how can we be sure? To look at data, you use the SELECT statement.
After SELECT, you specify the columns of data you would like. If you enter an asterisk, it will return ALL columns. The FROM command is used to specify the table name. Execute… Our one movie is there. Notice in the “users” and “movies” tables there are columns with names ending
In “ID”. These are numbers which uniquely identify each row of data. Such values are called “primary keys.” We provided the value for “movie_id”. But most respectable database software will create the IDs for you. So going forward, we will not specify the
“user id” or “movie id”. If you only want to view the movie titles, you can perform a SELECT with just the “titles” column. As before, you use FROM to identify the table to select from. Execute… Let us now populate our database with a lot more data… Generally you will use software to insert
Data. Let us now select all the movies and their prices. Notice they are not in any particular order. You can order by PRICE with the ORDER BY command. By default, the records are sorted in ascending order. You can sort in descending order with the DESC keyword;
You can change existing data with the UPDATE statement. If you want to update the price of Jaws, you specify the table to update… Use the “SET” statement to specify the new value. And then use a WHERE statement to restrict the update to specific records. Execute…. And verify the change…
To get rid of data, use the DELETE FROM statement. After “DELETE FROM” enter the table name. Next, enter a WHERE statement to specify which records to delete. This will delete the movie “Star Wars” from the database. … A quick SELECT will confirm its disappearance. Much like the original scene where Han shot first.
But we are just getting started. What if the data you need is scattered across multiple tables? The SELECT statement gives you the ability to choose data from multiple tables in a process called “Joins”. A related solution would be to create a virtual table called a “View”. This table-like object collects matching data
From multiple tables and makes it easily accessible as if you were working with a single table. And what about speed? When you execute a SELECT statement with a WHERE clause, the database may have to look at every single record in the table to find
Matching data. If there are billions of records, this can be slow. An Index can be created to ensure your queries are fast and efficient. Transactions provide you the ability to make several changes and ensure that your data is safe if there is a problem part way through
The process. The list of features is long… Today we have seen the essential SQL statements. The ability to manage a database schema with the CREATE, ALTER, and DROP commands. The statements used when working with data: SELECT,
INSERT, UPDATE, and DELETE. But now it is time to take that can of air and clean out your keyboard. Grab a towel, don’t panic, and click subscribe. Because you will want to hitch a ride on this ship. Subscribe to see the next exciting episode of SQL.
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉
Is this AI ROBOT ….?
Can you do a NoSQL video for CouchDB and MongoDB please? Also for Spark would be amazing!
DROP DATABASE *;
I love your personality and humor while sharing great information. I've used SQL for 20+ years but forgot a lot of the 'details' and this helped me a lot. Thank you!
Pan-Galactic Gargleblaster… I love your nerdyness. All Hail Douglas Adams!
Most impressive
Spectacular OVERVIEW !
Your videos are the only way I was able to learn SQL. You keep them fun. Thank you for helping with my job.
Thanks for your great SQL performance for beginners. The music is also awesome. I really love your kind of teaching and humour.
The word "relational" refers to the fact, that the data are represented as a relation (table). Not to a fact that tables can have associations as you mention in your video.
well done fellow human, not advanced AI, this tutorial was excellent and beneficial refresher
I have one problem watching her videos, the sound is scary…..Thats why i cannot watch even or 5 seconds. So please try avoiding these sounds in your videos.
learned more in 12 minutes of first few videos than I have learned in my entire course of introduction to databases with my joke of an online school, and that cost me 35k for the degree.
👍👍👍
Loved it *100000
“To create a database you use the bizarre command: create database” lol, this is the only SQL video that’s ever made me chuckle, well done.
hahaha this is so funny! I love the Hitchhikers Guide references
this Chanel awesome. your content very clear. thank you keep up
In short video they explained my whole 1ch..and my time got conserved… This video is fantastic…. With 100 percent efficiency… 👍🏻
Pan Galactic Gargle Blaster! 👍Well played, hitchhiker. Well played.
Next level stuf
Loved the video but I would suggest if you could provide a course for beginners to advanced to be interview prepared. Cover all the concepts so that I would be easier to crack interview. Thank you for the amazing video
Dayumn!
Content was so good, I turned off my adblocker
I like your serious voice
No idea how long it took you to edit these videos. But im actually mindblown lmao. Love these videos so much, very well done
Amazing simply amazing
I could have used this last week when we had a whole exam on SQL databases… Oh well, I still got a 93 on it lol
Need to see this in a real IDE. Unusable for me. Sorry.