Computer Science‎ > ‎

Databases and SQL: Introduction to a Real Life Example - Coming up with Schemas for Tables

SQL QUERIES : Schema and content of tables used in our tutorials.



In a survey, the information about students of a college is collected. Following is the schema :
( This will form the basis for the tutorials about SQL Queries ).

Student ( SName , St_Id , Bdate , Address, Sex, Br_No)
Branch (BName , BNo)
Courses ( CName,CId,BNo)
Resources ( St_Id, CId, No_of_Resources)

The database for the schema :

Student:
SNameSt_IdBdate

Address

SexBr_No
Anjali120126-06-199112,Lajpat Nagar,DelhiF

5

Ahmad120220-10-19902113,Sec42,ChandigarhM

5

Sonia120319-02-199019,Patel Road, DelhiF

3

Mudit120422-05-199054/A,RiverRidge, PuneM

4

Vamsi120504-03-199178-1,Sec10,BhilaiM

1

Namita120622-01-1992N-56,UdayShree, JaipurF

4

Himmi120725-04-198945,Jubliee Hills,HyderabadM

2

Goral120831-03-199289/C,Nilgiri Flats, AjmerF

2

Parag120915-08-199356A,EatStreet,ChennaiM

3

Varun121005-09-199023/1,West Kings, PuneM

1

Gaurav121107-07-1991P-63, Deodar Road,PatialaM

5

Tanvi121211-09-199110-C, MG Road, KanpurF

4



Branch:
BNameBNo
Comp.Sci1
Electronics2
Mechanical3
Chemical4
Civil5


Course:
CNameCIdBNo

Data Structures

11

1

Chemical Analysis

21

4

Circuit Design

31

2

Automobile Engg

41

3

Organic Chemistry

51

4

Building Engg

61

5

Operating Systems

71

1

Electrical Science

81

2



Resource:
St_IdCIdNo_of_Resources

1201

61

4

1202

61

2

1203

41

5

1204

21

3

1205

11

2

1205

71

6

1206

21

8

1206

51

3

1207

41

6

1208

31

2

1208

81

1

1209

41

4

1210

11

2

1210

71

4

1211

61

6

1212

51

7

Comments