Followers

Showing posts with label EXE 11. Show all posts
Showing posts with label EXE 11. Show all posts

EXE -11 To create simple tables , with only the primary key constraint ( as a table level constraint & as a field level constraint) (include all data types)




Create database:


1  -  Create a table with details as given below Table Name=> PLAYER


Columns

Column Name

Column Data Type

Constraints

1

player_id

Integer

Primary key

2

Name

varchar (50)

 

3

Birth_date

date

 

4

Birth_place

varchar(100)

 



Table level constraint-No

Ans.
create table player(
player_id integer primary key,
name varchar(50),
birth_date date,
birth_place varchar(100)
);
player;

 ----------------------------------------------------------------------------------------------------------------------------


2 - Create a table with details as given below  Table Name=> Student


Columns

Column Name

Column Data Type

Constraints

1

Roll_no

integer

 

2

Class

varchar (20)

 

3

Weight

numeric (6,2)

 

4

Height

numeric (6,2)

 

 

Table level constraint=> Roll_no and class as primary key


Ans.
                 create table student(
Roll_no integer,
class varchar(20),
Weight numeric(6,2),
Height numeric(6,2),
primary key(Roll_no,class)
);

---------------------------------------------------------------------------------------------------------------------------- 

EXE -11 To create simple tables , with only the primary key constraint ( as a table level constraint & as a field level constraint) (include all data types)

Create database: 1  -  Create a table with details as given below  Table Name=> PLAYER Columns Column Name ...