HomeОбразованиеRelated VideosMore From: The Bad Tutorials

SQL Tutorial - 9: Create Table Statement

1001 ratings | 272463 views
In this tutorial we'll learn to create tables in SQL using the CREATE TABLE Statement.
Html code for embedding videos on your blog
Text Comments (63)
Avaneet Chowdhary (12 days ago)
accha h bt language me thodi problem h so ...thaku for that
ATIKUR RAHMAN (14 days ago)
Sir ... What is this application software
Rogelio Cruz (21 days ago)
Thanks a lot man, you made it very simple!
Geeta Yadav (29 days ago)
Ratahe kya kya bol rage ho
Rohit Bhardwaj (1 month ago)
where are u doing this on which database
Manju Bajaj (2 months ago)
suppose i want to create a table name ABC using DDL queries... in this table we have a column named as month.. i want that values of month should integer between 1 and 12 only? can u plz help me how to write a DDL query for this in MS-Access?
ALESSANDRA PUCCIO (2 months ago)
thank you
westfield90 (2 months ago)
How do you specify Auto Increment and also collate charset etc?
shamim ahsan (3 months ago)
Is it case sensitive language?
The Perfect Tutorials (4 months ago)
https://youtu.be/akqPIhFD9Ro
ronoy188 (5 months ago)
what software
Rukhsar Usmani (6 months ago)
which software is it?
ANIRBAN (7 months ago)
I wrote datatypes in uppercase then compilation told that table not formed ,but in lowercase it formed ,Why?you told that they are not case sensitive
Nour Kenitra (9 months ago)
Still unclear We need a clear practice
HIRAK MONDAL (9 months ago)
The concept of primary key must be taught first then all these...
Moshfiqur Raham Bakshi (10 months ago)
Thank you so much for sharing it.
Amit Kumar Gaur (11 months ago)
Thanks for video bt I also want Oracle and java core,advance full video pls help me sir
Aayan Media (4 months ago)
https://www.youtube.com/watch?v=un7JloE-8BY
malik fayiz (1 year ago)
Thank you for posting the video, I appreciate it.
Amol Mundada (1 year ago)
plz tell me why ID field can not hold NULL values...in video at time 7:00
Moepi Maile (1 year ago)
Sir Can you check if my answer to this question is right pls Write a single SQL statement to create a new table named Login with five columns: Username(Text), Password(Text) LastUpdate(Date) Status(Text) and CustomerID(Interger) Assign Username as the primary key of the table The Password should never be NULL Set the default value of LastUpdate to the current date and time (Aust Time) Define a check on Status to make sure the value could either be active or inactive Assign CustomerID as a foreign key referencing the Customer table ANSWER CREATE TABLE Login (Username TEXT PRIMARY KEY NOT NULL, Password TEXT NOT NULL, Last Update DATETIME DEFAULT GETDATE (NZTIME), Status TEXT CHECK (Status = "active" OR Status = "inactive"), FOREIGN KEY (CustomerID) REFERENCE Customer (CustomerID) ON DELETE NO ACTION ON UPDATE NO ACTION )
Subrat Mohapatra (1 year ago)
though the output is executing correctly, there are red cross symbols against the steps written in the workbench.Can u pls clarify on the same ?
Muhammad Usama (1 year ago)
hi, Sir what command we used for MS SQL for describe a table.?
Fransuwel Mesquita (1 year ago)
great!!!!
The Bad Tutorials (1 year ago)
+Fransuwel Mesquita Thanks!
Bilal B (1 year ago)
which software i should download on my PC for SQL like we use dev for C++
use tmd gcc compiler
Yergalem Andetsion (1 year ago)
thanks
Funny Toaster (1 year ago)
not sure if i'm putting it wrong or i'm just plain stupid 3 create table cats 4 ( 5 id int primary key, 6 name varchar(30), 7 dob datetime, 8 email varchar(40), 9 ); yet still getting the Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 7
Ananya Srikanth (1 year ago)
welcome!
Funny Toaster (1 year ago)
solved already btw but thanks for telling knowing that someone noticed it
Ananya Srikanth (1 year ago)
remove the comma after email varchar(40).
Noluthando Leeto (2 years ago)
thanks for sharing i neede this
Aayan Media (4 months ago)
https://www.youtube.com/watch?v=un7JloE-8BY
MrAdschahal (2 years ago)
CREATE TABLE Employee ( id int primary key, name varchar(40), DOB datetime, email varchar (50), ); Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6 how can i remove this error please help
S G (1 year ago)
MrAdschahal there should be no last comma after email varchar(40)
Funny Toaster (1 year ago)
still not working
Code Radar (1 year ago)
remove space between varchar AND (50)
A el-aina (2 years ago)
how do you clear the action output in MySql ?
Jubril Wilson (2 years ago)
Thank you for sharing!!
Rehan Ilahi (2 years ago)
bro how do we create a table in c sharp windows form
the end18 (2 years ago)
fuck you. stop talking and go to the point. fucking nerd.
Carla X (1 year ago)
Marlene Favelo if you don't like it, go find yourself another tutorial, stupid bitch
Aditya Rawat (2 years ago)
fuck you !! He is damn good.
Gyan (2 years ago)
nice bro...
Arindam Joarder (2 years ago)
Motherfucker talks so much
sun shine (6 months ago)
He's explaining you idiot.
Sahil Agarwal (2 years ago)
name is also a keyword in mysql,isnt it? because it has turned out to be blue immediately when it was typed. can we use keywords for the name of the field??
silentblad (2 years ago)
Great video & Thanks for the tutorials from Canada!
Jyotsana Mogha (2 years ago)
You are such a genius, a good teacher, loved all your SQL videos. Thank you
Oscar Healy (2 years ago)
I am glad i came across this
Thusitha Maduranga (2 years ago)
THIS LESSON IS SUPERB
Nimish Pawar (2 years ago)
thankyou soo mch :)
Jigga Mane (3 years ago)
Thank you now I understand how to CREATE TABLE using SQL
Linkon (3 years ago)
if i want to add boolean datatype and want to set it's default value to false,  how can i do that?
praveen kumar (3 years ago)
superb tutorial
Aayan Media (4 months ago)
https://www.youtube.com/watch?v=un7JloE-8BY
Mez Coppa (3 years ago)
These are great videos. At first, I wasn't sure how they'd be, but they've been great. I wanted to do something else whilst learning Java.
Aayan Media (4 months ago)
https://www.youtube.com/watch?v=un7JloE-8BY
Swaraj (3 years ago)
We can have primary key on more than one column..not sure if it's your dbms limitation?
Oscar Healy (2 years ago)
+Swaraj he meant you can only have one primary key in any given table
syedsoyab soyab (4 years ago)
Nice
BoYcLuE (4 years ago)
This was fantastic. Exactly what I needed for my studies, thank you.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.