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) |
|
Ans.
create table player(player_id integer primary key,name varchar(50),birth_date date,birth_place varchar(100));player;
----------------------------------------------------------------------------------------------------------------------------
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) |
|
Ans.
Roll_no integer,class varchar(20),Weight numeric(6,2),Height numeric(6,2),primary key(Roll_no,class));
----------------------------------------------------------------------------------------------------------------------------
Columns |
Column Name |
Column Data Type |
Constraints |
1 |
project_id
|
integer |
Primary key |
2 |
Project_name |
varchar (20) |
|
3 |
Project_description |
text |
|
4 |
Status |
Boolean |
|
Table level constraint
create table project(id integer primary key,name varchar(20),description text,status boolean);project;
1] Create table for the information given below by choosing appropriate data types and also
specifying proper primary key constraint on fields which are underlined
1. Property ( PROPERTY_ID-pk, property_desc , area, rate, agri_status )
2. Actor ( actor_id-pk, Actor_name, birth_date )
3. Movie(movie-no-pk, name, release-year )
4. Hospital(hno-pk,hname,hcity)
Ans.
1]create table property(id integer primary key,descr text,area text,rate integer,status boolean);2]create table actor(id integer primary key,name text,dob date);3]create table movie(no int primary key,name text,ryear integer);4]create table hospital(hno int primary key,hname text,hcity text);
It's saying missing right parenthesis
ReplyDeleteThis comment has been removed by a blog administrator.
DeletePlease copy the code with all the parenthesis
Delete