DBMS: Creating Databases and Tables in My SQL


  • Without any Normalization, design the following table with the name 'video-lib' in My SQL.


i) Firstly we need to create a database in My Sql. Let's create a database with the name 'dev'.
ii) Open My SQL Server/ Client and type-
create database dev;
A database will be created with the name 'dev'.



iii) Now to create a table we need to use any database. Let's use our 'dev' database.
use dev;
iv) To create table type-
create table video_lib (Full_Name varchar(20), Physical_Address varchar(20), Movies_Rented varchar(50), Salutation varchar(5), Category varchar(20), primary key (Movies_Rented));


v) Now to insert records/ values in the table, type the following-
insert into video_lib values
("Janet Jones","FirstStreetPlotNo4","Pirates of the Caribbean, Clash of the Titans","Ms.","Action,Action");



insert into video_lib values
("Robert Phil","3rd Street","Forgetting Sarah Marshal, Daddy's Little Girls", "Mr.", "Romance,Romance");



insert into video_lib values
("Robert Phil","5th Avenue","Clash of the Titans", "Mr.", "Action");



vi)To view your table 'video_lib', type-
select * from video_lib;



Comments

Popular Posts