Welcome to Creating Tables. After watching this video, you will be able to: List considerations for creating tables Describe how to create a table in a graphical interface like Db2 on Cloud Explain how to alter table structure after creation When creating a table, you will need some information at hand. First, where will you create the table? Many relational databases have Schemas, which provide a way of organizing database objects into logical groups. For example, in IBM Db2 on Cloud, you will store tables, views, functions, and other database objects in your own user schema. Next, you must ensure you have all the information you need to create the table, including a name for the table, and names and data types for each column. You should also consider whether a column can contain duplicate values, or if a column will allow null values. Use the Entity Relationship Diagram you created as part of your database design to guide you. You can create tables in several different ways. Most databases have a visual or graphical interface that you can use to create and modify tables. These are great for small, occasional tasks, but they don’t scale well. You can also create tables with the CREATE TABLE SQL statement, which can be included in a script file to help you automate the creation process when you are creating multiple tables. Finally, some databases have administrative APIs for creating and managing databases programmatically. The illustrations provided in this video are based on Db2 on Cloud console examples, similar concepts apply to other databases. The first step in creating a table using the Db2 on Cloud console is to choose a schema to hold the table. In this case, the user schema, CQC63405 is selected. In Db2 the default schema is the username. In this example, you can see that the username is CQC63405. Each user will have a different username, so you will see a different username in your own Db2 database. You can create new Schemas to hold your tables, views, and other database objects. In this case, the user schema, CQC63405 is selected. Select New table to create a new table. Give your new table a name. In this example, the table is named Employee details. Because it exists within the CQC63405 schema, the fully qualified name for this table is CQC63405.Employee Details. The new table has a single column by default. You can rename this column to fit your needs. Set a data type for your column by selecting one from the list. Use Add column to continue to add columns until you have constructed the entire table. Remember to specify the data type for each column. You can also specify whether the column accepts null values, and specify length and scale depending on the data type. Lastly, click Create. There are many actions you can take once you have created the table. You can Drop, or delete, the table. You can Generate SQL code to perform actions such as SELECT, INSERT, UPDATE, and DELETE. You can ALTER the table to add a new column, set constraints, or change the structure of the table in some other way. And you can see the database objects that the table depends on. In this video, you learned that: Many Relational Database Management Systems (RDBMS) have schemas which contain tables, views, functions, and other database objects. Most RDBMS provide a GUI which you can create tables through. You can also use SQL statements to create tables. You can alter the structure of the table after it’s created, should you need to add a column, change a data type, or add a primary or foreign key.