Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
31 views
Dbms Queries
DBMS queries
Uploaded by
Navyasree Golusula
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save dbms queries For Later
Download
Save
Save dbms queries For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
31 views
Dbms Queries
DBMS queries
Uploaded by
Navyasree Golusula
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save dbms queries For Later
Carousel Previous
Carousel Next
Save
Save dbms queries For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 8
Search
Fullscreen
der the relational schema for Part of the dreamhome case study © saints: "Create a database with name “DreamHeme” and now create all the tables sted above with const + Sranch(branchno streetcty postcode) Create table b varchar(8)}; stcode "ch(branchno char) primary key stret varchar(20) not nul city varcha(20) not nl PO! utp Table created, 2.statt St2tfno,fname,tame,position sex,008,salarybranchno) ‘“reate table staffistatino varchar(7) primary key,{name varchar(10) not null,Iname varchar(10) ot nullpostion varchar(20) not nulsex char,008 date salary decimal(7,4) not null,branchno char( 4) not null foreign key(branchno) references branch{branchno)); Output: Table created. 3-Porpertyforrent(propertyno street, city,postcode,type,rooms,rent, Greate table propertyforrent(propertyno char{) primary key,stret varchar(20) not null city varchar(15) not nll, OS" 20de varchar(6) not null, type varchar(8) not null,rooms smallint not null, rent decimal(9,3) not null,ownerno. varchar(7) not null, staffno: ‘varchar(5) foreign key(staffno) references staff (staffno),branchno char(4) not null); ownerno,staffno.branchno) Output: Table created. 4.Client(ctientno,fname,Iname,telino,preftype,maxrent email) create table client(clientno char(4) primary key fname varchar(10) not null,iname varchar(10) not null, telino varchar(20) not null,preftype varchar(8) not null maxrent decimal(6,1),email varchar(25) not null; null); Output: Table created. 5.Privateowner(owerno fname,name,address,tellno,emall, password) create table privateowner(ownerno char(4) primary key, fname varchar(8) not nullname varchar(10) not null,address varchar(30) not nulltelino varchar(15) not null, email varchar(25) not nul passsword varchar(10)); Output: Table created. 6.Viewing(clientno,propertyno,viewdate,viewcomment) create table viewing(clientno varchar(6) primary key,propertyno varchar(8) not null,viewdatedate,viewcomment varchar(20)); Output: Table created. Scanned with CamScannersaistration{clientno,branchno,staffno,datejolned) fate table registration(ctinetno char(4) primary key,branchno varchar(6) not nullstaffno varchar(6) not nul, ‘tejoined date}; Output: Table created 2,Jinsert a new row into the table supplying data for all columns 2.Biunch(branchno,street,city,postcode) insert into branch values('8005 22 Deer Rd! "London’ SW1AEH'); 1 row created. insert into branch values ('8007''16 Argyl St‘Aberdeen’’AB2 35U)); 1 row created. insert into branch values('B003''163 Main St, 'Glasgow’,'G11 90%’); 1 row created. inert into branch values('8004"/'32 Manse Rai,’Bristol,'3S99 1NZ’); 1 row created. insert into branch values('8002','6 Clover Dr'London’,'NW 10 6EU'); row created, select * from bran BRANCHNO STREET cay POSTCODE B005 22 Deer Rd London’ ‘Swi 4EH 8007 16 Areyilst Aberdeen ‘AB2 3SU 003 163 Main St Glasgow G11 90x Boos 32 Manse Rd Bristol 18599 1NZ 002 56 Clover Dr London NW 10 6U 2.Stafi(staffno,fname,lame position sex,DOB, salary, branchno) insert into staff values('S121', John',White',’Manager’,'M''1-Oct-45','30000','B005'); Lrow created. insert into staff values('SG37’,'Ann','Beech','Assistant’ F'10-Nov-60'/'12000,'8003'); 1 row created. insert into staff values('SG14’,'David','Ford' ‘Supervisor ''24-mar-58,'18000",'8003'); 1 row created. insert into staff values('SAS'/Mary' Howe',’Assiatant’ ,'19-Feb-70',9000','8007'); 1 row created. : insert into staff values('SGS" Susan’ 'Brand',’Manager’,F'3-jun-40','24000' 8003); 11 row created. cert into staff values('SLJulie''Loe' Assistant’ ''13-june-40','9000''8005'); ins Scanned with CamScannersow created, select * from staff; | STAFFNO | FNAME | ~UNAME | Postion” | “s bon SALARY sia] John [White | ~ Manager| M | O1-0CT-45 30000 | - ‘Ann | Beech | Assistant | F | a0-NOVv-co |” 12000 S614] David [Ford | Supervisor | 2a-miansa | 18000 SAS Mary | Howe: Assiatant’ | F | 19-FEB-70 ‘9000 8007 $65] Susan | Brand Manager | F | O34UN-40 24000 ‘8003, Sar Tulle toe ‘sistant | F | 43dUN40 9000 8005 3.Porpertyforrent(propertyno,street city, postcode, type, rooms,rent,ownerno,staffno.branchno) insert into propertyforrent values('PA14'16 Holhead' ‘Aberdeen',’AB7 5SU’,'House’'6''650, ‘coal \'SA9! 'B007"); 1 row created. insert into propertyforrent values('PL94’,'6 Argyl St London','Nw2;, Flat, 4','400'/CO87" 1'5L41'/'B005'); t row created. insert into propertyforrent values('PG4','6 Lawrence St'/Glasgow',’G11 9QX;,'Fat,'3,350'" c040',"'8003'}; L row created. 175''C093'S637 insert into propertyforrent values('PG36,'2 Manor Rd 'Glasgow',/G32 40X Flat’ "18003"; Lrow created. insert into propertyforrent values('PG21'/'18 Dale Rai, 'Glasgow’'G12', "S637, Lrow created. 50'CO Novar Dr''Glasgow’,'G12 AX, Flat’ insert into propertyforrent values(/PG1 93'/'SG14'/'B003"); 1 row created Scanned with CamScanner._ lect * from propertyforrent1; eROPERTYNO | STREET | CITY | POSTCODE | TYPE RENT [ OWNERO | STAFENO | BRANCHNO PAI4 16 Aberdeen | AB75SU | House | 6 650 C046 SAD 007 Hothead PLO4 G Argyll | London Nw2 Flat | 4 400, co87 SL41 00S St PG4 6 3 350 co40 8003 Lawrence | Glasgow | G1190X | Flat St PG36 2Manor | Glasgow | G32 4QX Flat | 3 375 C093 ‘$637 003 Rd PG21 18Dale | Glasgow G12 House | 5 600 co87 $637 B003 Rd PG16 SNovar | Glasgow G12 AX Flat | 4 450 C093 SG14 B003 Dr Grows selected. 4.Client{clientno,fname,Iname,tellno,preftype,maxrent,email) insert into client values('CR76,John’,'Kay’0207-774-5632,, lat’ '425',
[email protected]
'); 1 row created. Insert into client valuest'CRS6,Aline'Stewart’'0141-848-185' lat’ '350','
[email protected]
'); 1 row created. insert into client values('CR74','Mike' 'Ritche' '01475-392176,,'House’,'750,'
[email protected]
'}; Lrow created. insert into client values('CR62!,"Mary,Tregear,'01224-196720', Fat','600''
[email protected]
’); L row created, select * from client; CLIENT [FNAME] LNAME | TELLNO PREFTYPE | MAXRENT | EMAIL R76__| John _| Kay | 0207-774-5632 Tat 425 | john.kay@gmailcom R56 | Aline _| Stewart | 0141-848-1825 | flat 350 |
[email protected]
CR74__| Mike | Ritche | 01475-392176 | House | 750 |
[email protected]
cR62__| Mary _| Tregear_| 01224-196720 Flat 600 __ |
[email protected]
5.Privateowner{ownerno,fname,iname,address,tellno,email,password) insert into privateownervalues('CO46',Joe,'Keogh’,'2 Ferguus Dr,Aberdeen AB2 7Sx’,01224- ieeweenens): 861212,
[email protected]
’, row created. insert into private owner valuest"CO87’,'Carol,'Farrel’,'6 Achray St,Glasgow G32 9AX’,0141-848- 1825,'
[email protected]
,*****#**'); 1 row created. insert into privateownervalues('CO40’,‘Tina',’Murphy''63 Well St,Glasgow G42', 0141-943- 1728,'
[email protected]
’,'********"); row created. Scanned with CamScannerinsert into privteownervalues('CO93},"Tony’,'shaw’'12 Park Pl,Glasgow G4 OQR’,0141-225-7025, ‘tony
[email protected]
, *#+¥4940 ‘Lrow created. select * from privateowner; ‘OWNE | FNAME | LNAME “ADDRESS TELINO EMAIL PASSWORD RNO Coa6 | Joe | Keogh | 2FerguusDrAderdee | 01224861212 | _
[email protected]
coueeaee 1 AB27SX C087 | “Carol | Farrel | 6 Achrayst,Glasgow | 0141-357-7419 | cfarrel@gmailcom G3290x Coao | Tina | Murphy | 63WellSt,Glasow | 0141-943-1728 | tinam@hotmailicom a2 O83 | Tony | Shaw | 12ParkPllasgow | 0141-2257025 | tonyshaw@arkcom | ****ee* Ga00R 6.Viewing(clientno,propertyno,viewdate,viewcomment) insert into viewing values('CR56;PA14''24-May-13'Too small’; 1 row created, insert into viewing values('Cr76",'PG4’,'20-Apr-13','too remote’); Lrow created insert into viewing values('CRS6;,'PG4’,26-May-135'"); Lrow created. insert into viewing values('CR62',PA14’,'14-May-13','no Dining Room’); 1 row created. insert into viewing values('CRS6;PG36,'28-Apr-135,"); 1 row created. select * from viewing; CLENT PROPERTY VIEWDATE VIEWCOMMENT RSS PAIS 24MAY-13 “Too small 176 PGS 20-APR-13 too remote RSE PGs 26-MAY-13 R62 PAI EURYINEE] ‘no Dining Room CRS6 P36 28-APRA3 7.Registration(clientno,branchno,staffno,datejoined) insert into registration values('CR76;,'B005','SL4: row created. insert into registration values('CRS6','B003', row created. insert into registration values('CR74','8003''SG37\"16-Nov-11); Scanned with CamScannerA row created, tnsert into registration values('CR62''8007'SA9',7-Mar-12'), 1 row created, select * from registration; CLINENTNO. BRANCHNO _[STAFFNO | _DATEJOINED CR76 O05 Sud O2-JAN-13 RSG 003 ‘G37 LLAPR-12 R74 003 ‘5637 16-NOV-11 CREZ 8007 SA. (O7-MAR-12 23. update Staff set fName="Dravid' where staffNo='SL21"; Select * from Staff; Output: STAFENO FNAME” LNA! siz Dravid White 037 Ann Beech son Dead For May Howe ‘Susan Brand ie bse POSITION Manager ‘sistant ‘Assistant u & Supenisor F F F Manager 4, Delete from Staff where staffNo='SL41'; Select * from Staff; STAFFNO sit David White sc37 Ann Beech sore David = Ford Mary Howe Susan FNAME _LNAME POSITION S.alter table Branch add email varchar(20);, desc Branch; output: Table Column _ ppawc BRANCHN u 9 STREET omy POSTCODE EMAIL Data Type ‘Number Varchar2 Varehar2 Number Varchar2 Lengt 2 20 SEX sex” //b08 SALARY BRANCHNO 01 30000 8005, foNov.so 12000 003 2aMaR-s8 16000 8008 19FEB-70 9000 007 Precisle | Seal Primary Key SALARY BRANCHNO | Nultabt QNVOn 8 Defaut t Commen t Scanned with CamScanner_/& drop table Branch; desc Branch; output: Object to be described could not be found, 7. truncate table em select * from emp; output: ho data found 8. create index Indext on Staff(fName,|Name); Output: Index created. drop index Index on Staff; 9. select * from Registration; Output: {[GLieWTNO” BRANCHNO” STAFFHO DATEVONED rn a cre mn sor tans | cam cov wenover | neem cao onan 10. select * from Staff; Output: waite” POSITION” SEX DOB SALARY BRANCHNO | FNAME “bravid White -—=«sManager-=«M~—=«=«OY-0CT-45 20000 BOOS | Ann Beech Assistant «= F_=S«TONOVSD 12000 BOS Dovid Ford =—=««Supervisor.«M=—24MARSB 18000 (8003 May Howe = Assitant «=F IOFEB-7O 8000 007 F GaUN40 24000 BOO | 11, select * from Staff where salary>10000; output SYAFFNO FNAME LAME” PosiTioN SALARY” BRANCHNO Soma Wite Manager a gor km ook Matat waa ‘sGi4 David Ford ‘Supervisor M 18000 003, | r F 03-JUN-40 Manager Output: Scanned with CamScanner_ARoPERTYNO Poa Pata 13. select staffNo,{Name,IName,salary from Staff; output: STAFFNO FNAME LNAME SALARY si2t David — Whte 30000 | so37 An Beech 12000 | sou David Ford 18000 | sao May Howe 9000 | S65 susan Brand 2400 Scanned with CamScanner
You might also like
Dreamhome DDL
PDF
No ratings yet
Dreamhome DDL
3 pages
45677777MySQL - All Basics Query by Using PopSQL Text Editor
PDF
100% (1)
45677777MySQL - All Basics Query by Using PopSQL Text Editor
22 pages
Perbaikan Table
PDF
No ratings yet
Perbaikan Table
2 pages
CREATE DATABASE LabTask
PDF
No ratings yet
CREATE DATABASE LabTask
6 pages
Lec10 - Lab - CSC371 - Database Systems
PDF
No ratings yet
Lec10 - Lab - CSC371 - Database Systems
21 pages
TTTTTT
PDF
No ratings yet
TTTTTT
5 pages
Database Assignment-Ll Dream Home Database System Nasar Ahmad BSCM-F19-415
PDF
No ratings yet
Database Assignment-Ll Dream Home Database System Nasar Ahmad BSCM-F19-415
5 pages
Lab Fat Commands (Updated)
PDF
No ratings yet
Lab Fat Commands (Updated)
10 pages
Database Assignment-Ll Dream Home Database System Faisal Abbas BSCM-F19-404
PDF
No ratings yet
Database Assignment-Ll Dream Home Database System Faisal Abbas BSCM-F19-404
5 pages
Dreamhome
PDF
No ratings yet
Dreamhome
4 pages
Dream Home Data Dictionary
PDF
No ratings yet
Dream Home Data Dictionary
26 pages
lab 6
PDF
No ratings yet
lab 6
23 pages
BSC-IV SEM-Database Management Systems Lab
PDF
No ratings yet
BSC-IV SEM-Database Management Systems Lab
36 pages
Relational Algebra Tutorial Two
PDF
No ratings yet
Relational Algebra Tutorial Two
6 pages
SQL DBMS Assignment
PDF
No ratings yet
SQL DBMS Assignment
3 pages
Lab 6
PDF
No ratings yet
Lab 6
2 pages
More SQL Queries
PDF
No ratings yet
More SQL Queries
11 pages
Dreamhomerental Sqlserver Studentquery
PDF
No ratings yet
Dreamhomerental Sqlserver Studentquery
3 pages
Lab 4 SQL
PDF
No ratings yet
Lab 4 SQL
3 pages
Lec6 Lab CSC371 Database Systems
PDF
No ratings yet
Lec6 Lab CSC371 Database Systems
17 pages
INSERT Data in Branch:: INSERT Into Private Owner
PDF
No ratings yet
INSERT Data in Branch:: INSERT Into Private Owner
3 pages
DBMS Lab Manual
PDF
No ratings yet
DBMS Lab Manual
57 pages
Hotel Reservation Management System: A CAL Project Report On
PDF
No ratings yet
Hotel Reservation Management System: A CAL Project Report On
25 pages
Dbms Lab Manual
PDF
No ratings yet
Dbms Lab Manual
62 pages
My Own SQL Command Note For Batch3
PDF
No ratings yet
My Own SQL Command Note For Batch3
14 pages
DBMS Lab4 146
PDF
No ratings yet
DBMS Lab4 146
11 pages
DBMS lab project
PDF
No ratings yet
DBMS lab project
32 pages
Database Lab Program
PDF
No ratings yet
Database Lab Program
6 pages
RDBMS Lab
PDF
No ratings yet
RDBMS Lab
41 pages
Normalization
PDF
0% (1)
Normalization
7 pages
SQL Dunder Miflin Database code
PDF
No ratings yet
SQL Dunder Miflin Database code
4 pages
EX NO 4
PDF
No ratings yet
EX NO 4
8 pages
Constraints: Create KEY Name NOT Default
PDF
No ratings yet
Constraints: Create KEY Name NOT Default
17 pages
SQL Final
PDF
No ratings yet
SQL Final
76 pages
BANK Query
PDF
100% (1)
BANK Query
34 pages
DBMS Lab
PDF
No ratings yet
DBMS Lab
8 pages
SQL
PDF
No ratings yet
SQL
12 pages
Dbms Assignment: Solution
PDF
No ratings yet
Dbms Assignment: Solution
6 pages
21BCS3957 - Armaan Chahal - DBMS
PDF
No ratings yet
21BCS3957 - Armaan Chahal - DBMS
14 pages
Lec 6
PDF
No ratings yet
Lec 6
40 pages
Use Branch and Propertyforrent Tables in Examples (A), (B) and (C)
PDF
No ratings yet
Use Branch and Propertyforrent Tables in Examples (A), (B) and (C)
6 pages
Information
PDF
No ratings yet
Information
2 pages
schema-examples
PDF
No ratings yet
schema-examples
4 pages
Case Study 5
PDF
No ratings yet
Case Study 5
7 pages
LPiatek_DB_2024_LAB_03 (1)
PDF
No ratings yet
LPiatek_DB_2024_LAB_03 (1)
12 pages
ADBMS Practicals
PDF
100% (1)
ADBMS Practicals
75 pages
4.1-Database Objects
PDF
No ratings yet
4.1-Database Objects
19 pages
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
PDF
100% (3)
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
34 pages
Relational Algebra
PDF
No ratings yet
Relational Algebra
3 pages
Function Assignments
PDF
No ratings yet
Function Assignments
6 pages
BANK
PDF
No ratings yet
BANK
26 pages
Set Search - Path To Sales CREATE TABLE Customers (Id Integer NOT NULL, Lastname Text NOT NULL
PDF
No ratings yet
Set Search - Path To Sales CREATE TABLE Customers (Id Integer NOT NULL, Lastname Text NOT NULL
3 pages
EX NO 5
PDF
No ratings yet
EX NO 5
3 pages
Company Database sql script
PDF
No ratings yet
Company Database sql script
6 pages
Documentation CSC675 Project
PDF
No ratings yet
Documentation CSC675 Project
13 pages
Code Crate Table in Data Base
PDF
No ratings yet
Code Crate Table in Data Base
3 pages
d226548b-b801-406d-862f-98c6f66e4f17
PDF
No ratings yet
d226548b-b801-406d-862f-98c6f66e4f17
7 pages
Foreign Key
PDF
No ratings yet
Foreign Key
39 pages
System: By: Ono Masatoshi
PDF
No ratings yet
System: By: Ono Masatoshi
10 pages