What is the SQL Create Table Clause Statement Language Eleme...

What is the SQL Create Table Clause Statement Language Element? (...  

Phillip Photo
Phillip
2 months
1 Views
Want to watch this again later?
Sign in to add this video to a playlist. Login
0 0
Category:
Description:
▶ C'mon over to https://realpars.com where you can learn PLC programming faster and easier than you ever thought possible!

=============================

▶ Check out the full blog post over at https://realpars.com/sql-create-table/

=============================

If you are just now joining along with this series of videos, please note that you are going to learn about SQL programming basics.

In the previous video, What are the SQL Subquery and Exists Clause statement language elements (https://realpars.com/sql-subquery/), we learned about some of the advanced data definition SQL statements such as, Subquery and Exists.

In this video you will learn how to create a table in the database, using the Create Table statement.
The CREATE TABLE statement will create a new table.

So far in our SQL lessons, we have been working with SQL Data Manipulation type statements.

In order to continue to work with advanced SQL Data Manipulation type statements, we will need to understand about the Data Definition statements.

Data Definition statements allow for the creation of additional tables and columns. With these statements, we will create new tables and columns. New columns created will contain specific data types defining whether they are Numeric, String or Datetime and the amount of space they will take up.

Similar to PLC data types, MySQL uses the data types in queries. In the query used in this video, the column named Lesson_ID utilizes INT data type and the column named Status utilizes TINYINT data type.
The column name Subject will utilize VARCHAR data type and the column named Description will utilize TEXT data type or string type data.

Because we created a table with a Data Definition statement and did not utilize a Select Data statement to be listed in the Output panel, no results will be displayed. Instead, we will be able to see listed in the Navigator panel, a new table called Lessons and the columns we added to the Lessons table.

A relational database consists of multiple related tables linked together using common columns. These columns are known as Foreign Key columns. For example, in our sample database, the Orders and OrderDetails tables are linked using the OrderNumber column. To get complete orders data, we will need to query data from both Orders and OrderDetails tables and this is where the JOIN comes into the play.

JOIN is a method of linking data between one or more tables based on the values of a common column between tables. To join the tables, you can use the CROSS JOIN, INNER JOIN, LEFT JOIN or RIGHT JOIN clause for the equivalent type of join. The join clause is used in the SELECT statement that appeared after the FROM clause.

=============================

To learn more about MySQL and additional SQL statements, visit the MySQL website: https://dev.mysql.com/doc/refman/8.0/en/create-table.html

Review the MySQL minimum hardware requirement web page here: https://forums.mysql.com/read.php?11 ,629199,629211

Download the MySQL Installer: https://dev.mysql.com/downloads/installer/

Download the sample database SQL file from here: https://realpars.com/wp-content/uploads/2019/12/realparssampledatabasev2.zip

Download the sample database diagram file from here: https://realpars.com/wp-content/uploads/2020/01/RealParsSampleDatabaseV2-Diagram.zip

=============================

Missed our most recent videos? Watch them here:
https://realpars.com/bcd/
https://realpars.com/actuator/

=============================

How to Install MySQL and Import a Sample Database (Part 1 of 8) https://realpars.com/mysql

What are SQL Programming Basics? (Part 2 of 8) https://realpars.com/sql

What are SQL Where and Like Statements Basics? (Part 3 of 8) https://realpars.com/sql-where

What are the SQL Order By Clause and Expression Statement Language Elements? (Part 4 of 8) https://realpars.com/sql-order-by/

What are the SQL Inner Join, And, Or, Having and Between Clause? (Part 5 of 8) https://realpars.com/inner-join/

What are the SQL Subquery and Exists Clause Statement Language Elements? (Part 6 of 8) https://realpars.com/sql-subquery/

=============================

To stay up to date with our last videos and more lessons, make sure to subscribe to this YouTube channel:
http://goo.gl/Y6DRiN

=============================

TWEET THIS VIDEO https://ctt.ac/a9dMb

=============================

Like us on Facebook: https://www.facebook.com/therealpars/

Follow us on Twitter: https://twitter.com/realpars

Follow us on LinkedIn https://www.linkedin.com/company/realpars

Follow us on Instagram https://www.instagram.com/realparsdotcom/

#RealPars #SQL #MySQL

Comments:

Comment
Up Next Autoplay