Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL Can you see what i have done because i did it but i still have problem
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


alhisnawy
Can you see what i have done because i did it but i still have problem
1 Answer(s)      4 years and 9 months ago
Posted in : SQL


This is what i have done but i still have a problem:-
Can you correct my mistakes?
-------------------------------------------------------
create database University_Accommodation_Office;
/*This is Student Table*/
Create Table Student
(
Matric_No nvarchar(10)not null, FName nvarchar(20)not null, LName nvarchar(20)not null,
DateOfBirth datetime, Sex nvarchar(1), Category_std nvarchar(15),
Nationality nvarchar(15), Smoker nvarchar(5), SpecialNeeds nvarchar(20),
Comments nvarchar(20), Status nvarchar(10), Course nvarchar(15),
Advisor_N0 nvarchar(5) not null, Room_No nvarchar(5)not null, Lease_No nvarchar(5) not null,
Invoice_No nvarchar(5) not null, Course_No nvarchar(5)not null, Address nvarchar(20),
Primary key (Matric_No) ,
Foreign key (Advisor_N0) references Advisor ,
Foreign key (Room_No) references Single_room ,
Foreign key (Lease_No) references Lease ,
Foreign key (Invoice_No) references Invoice ,
Foreign key (Course_No) references Courses
/*Foreign key (Kin_No) references NextOfKin,*/
);
----------------------------------------------------------------------------
/*This is Student Address Table*/
Create Table Std_Address
(
Matric_No nvarchar(15)not null, Street nvarchar(10), City nvarchar(20), PostCode nvarchar(20),
Primary key (Matric_No),
);
----------------------------------------------------------------------------
/*This is Addvisor Table*/
Create Table Advisor
(
Advisor_N0 nvarchar(15)not null,FullName nvarchar(20),Position nvarchar(20),
Dep nvarchar(20),Internal_Phone nvarchar(10),Room_No nvarchar(10)not null,
Primary key (Advisor_No),
Foreign key (Room_No) references Single_room not null,
);
----------------------------------------------------------------------------
/*This is Hall Tableš›–*/
Create Table Hall_Of_Residence
(
H_Name nvarchar(15),H_Address nvarchar(20),Phone_No nvarchar(20),H_Manager nvarchar(20),Room_No nvarchar(5) not null,
Foreign key (Room_No)references Single_room,
);
----------------------------------------------------------------------------
/*This is Invoice Table*/
Create Table Invoice
(
Invoice_No nvarchar(15)not null,Sem_Pay_Due nvarchar(10),
Place_No nvarchar(10)not null,Hall nvarchar(20),Flat nvarchar(15),
Primary Key (Invoice_No)references Invoice not null,
Foreign Key (Lease_No) references Leases not null,
Foreign key (Room_No) references Single_room not null,
/*Foreign Key (Place_No) references Place not null,*/
);
----------------------------------------------------------------------------
/*This is Leases Tableš›–*/
Create Table Leases
(
Lease_No nvarchar(15)not null,Duration nvarchar(10),Start_Date DateTime,End_Date DateTime,
Primary Key (Lease_No),
);
----------------------------------------------------------------------------
/*This is Single room Tableš›–*/
Create Table Single_room
(
Room_No nvarchar(5)not null,Place nvarchar(10),MonthlyRentRate Decimal,
Primary Key (Room_No),
);
----------------------------------------------------------------------------
/*This is Student Flat Tableš›–*/
Create Table Student_Flat
(
F_No nvarchar(5)not null,Address nvarchar(20),S_bedroom_No nvarchar(15),Lease_No nvarchar(15)not null,
Primary Key (F_No,S_bedroom_No),
Foreign Key (Lease_No) references Leases,
);
----------------------------------------------------------------------------
/*This is Single bedroom Tableš›–*/
Create Table Single_bedroom
(
Room_No nvarchar(5)not null,MonthlyRentRate Decimal,Place_No nvarchar(10),Lease_No nvarchar(15),
Primary Key (Room_No) /*references Single_room not null*/,
Foreign Key (Lease_No) references Leases,
/*Foreign Key (S_bedroom_No) references Student_Flat,*/
);
----------------------------------------------------------------------------
/*This is Invoice Status Tableš›–*/
Create Table Invoice_Status
(
Invoice_No nvarchar(5)not null,Paid_Date DateTime,Method nvarchar(10),ReminderOne nvarchar(10),ReminderTwo nvarchar(10),
Primary Key (Invoice_No),
);
----------------------------------------------------------------------------
/*This is Courses Tableš›–*/
Create Table Courses
(
Course_No nvarchar(5)not null, Title nvarchar(10),C_Leader nvarchar(10),
Internal_Phone nvarchar(10),Room_No nvarchar(5), Dep_Name nvarchar(10),
Primary Key (Course_No),
Foreign key (Room_No) references Single_room,
);
----------------------------------------------------------------------------
/*This is Inspection Tableš›–*/
Create Table Inspection
(
Inspection_No nvarchar(10)not null,Staff_Name nvarchar(10),Date DateTime,Sat_Condition nvarchar(10),Comment nvarchar(10),
Primary Key (Inspection_No),
);
----------------------------------------------------------------------------
/*This is Staff Tableš›–*/
Create Table Staff
(
Staff_No nvarchar(10)not null,FName nvarchar(10),LName nvarchar(10),
Sat_Condition nvarchar(10),Comment nvarchar(10),Address_1 nvarchar(20),
Primary Key (Staff_No),
);
----------------------------------------------------------------------------
/*This is Staff Address Tableš›–*/
Create Table Staff_Address
(
Staff_No nvarchar(15)not null,Street nvarchar(10),City nvarchar(20),PostCode nvarchar(20),
primary key (Staff_No),
);
----------------------------------------------------------------------------
/*This is Next-of-Kin Tableš›–*/
Create Table NextOfKin
(
Matric_No nvarchar(10)not null,Kin_Name nvarchar(10),Relationship nvarchar(10),
Address_1 nvarchar(20), Phone_No nvarchar(10),Kin_No nvarchar(15),
Primary Key (Matric_No,Kin_No),
);
----------------------------------------------------------------------------
/*This is Next-of-Kin Address Tableš›–*/
Create Table Kin_Address
(
Kin_No nvarchar(15)not null,Street nvarchar(10),City nvarchar(20),PostCode nvarchar(20),
primary key (Kin_No),
);

Advertisement
View Answers

February 18, 2010 at 12:22 PM


Hi Friend,

Create Table Student
(
Matric_No nvarchar(10)not null, FName nvarchar(20)not null, LName nvarchar(20)not null,
DateOfBirth datetime, Sex nvarchar(1), Category_std nvarchar(15),
Nationality nvarchar(15), Smoker nvarchar(5), SpecialNeeds nvarchar(20),
Comments nvarchar(20), Status nvarchar(10), Course nvarchar(15),
Advisor_N0 nvarchar(5) not null, Room_No nvarchar(5)not null, Lease_No nvarchar(5) not null,
Invoice_No nvarchar(5) not null, Course_No nvarchar(5)not null, Address nvarchar(20),
Primary key (Matric_No));


Create Table Std_Address
(
Matric_No nvarchar(15)not null, Street nvarchar(10), City nvarchar(20), PostCode nvarchar(20),
Primary key (Matric_No));

Create Table Advisor
(
Advisor_No nvarchar(15)not null,FullName nvarchar(20),Position nvarchar(20),
Dep nvarchar(20),Internal_Phone nvarchar(10),Room_No nvarchar(10)not null,
Primary key (Advisor_No)
);

Create Table Hall_Of_Residence
(
H_Name nvarchar(15),H_Address nvarchar(20),Phone_No nvarchar(20),H_Manager nvarchar(20),Room_No nvarchar(5) not null
);

Create Table Invoice
(
Invoice_No nvarchar(15)not null,Sem_Pay_Due nvarchar(10),
Place_No nvarchar(10)not null,Hall nvarchar(20),Flat nvarchar(15),
Primary Key (Invoice_No)
);

Create Table Leases
(
Lease_No nvarchar(15)not null,Duration nvarchar(10),Start_Date DateTime,End_Date DateTime,
Primary Key (Lease_No)
);

Create Table Single_room
(
Room_No nvarchar(5)not null,Place nvarchar(10),MonthlyRentRate Decimal,
Primary Key (Room_No)
);

Create Table Student_Flat
(
F_No nvarchar(5)not null,Address nvarchar(20),S_bedroom_No nvarchar(15),Lease_No nvarchar(15)not null,
Primary Key (F_No,S_bedroom_No)
);

Create Table Single_bedroom
(
Room_No nvarchar(5)not null,MonthlyRentRate Decimal,Place_No nvarchar(10),Lease_No nvarchar(15),
Primary Key (Room_No)
);

Create Table Invoice_Status
(
Invoice_No nvarchar(5)not null,Paid_Date DateTime,Method nvarchar(10),ReminderOne nvarchar(10),ReminderTwo nvarchar(10),
Primary Key (Invoice_No)
);

Create Table Courses
(
Course_No nvarchar(5)not null, Title nvarchar(10),C_Leader nvarchar(10),
Internal_Phone nvarchar(10),Room_No nvarchar(5), Dep_Name nvarchar(10),
Primary Key (Course_No)

);

Create Table Inspection
(
Inspection_No nvarchar(10)not null,Staff_Name nvarchar(10),Date DateTime,Sat_Condition nvarchar(10),Comment nvarchar(10),
Primary Key (Inspection_No)
);

Create Table Staff
(
Staff_No nvarchar(10)not null,FName nvarchar(10),LName nvarchar(10),
Sat_Condition nvarchar(10),Comment nvarchar(10),Address_1 nvarchar(20),
Primary Key (Staff_No)
);

Create Table Staff_Address
(
Staff_No nvarchar(15)not null,Street nvarchar(10),City nvarchar(20),PostCode nvarchar(20),
primary key (Staff_No)
)

Create Table NextOfKin
(
Matric_No nvarchar(10)not null,Kin_Name nvarchar(10),Relationship nvarchar(10),
Address_1 nvarchar(20), Phone_No nvarchar(10),Kin_No nvarchar(15),
Primary Key (Matric_No,Kin_No)
)

Create Table Kin_Address
(
Kin_No nvarchar(15)not null,Street nvarchar(10),City nvarchar(20),PostCode nvarchar(20),
primary key (Kin_No)
);
Thanks


Related Tutorials/Questions & Answers:
Can you see what i have done because i did it but i still have problem - SQL
Can you see what i have done because i did it but i still have problem  This is what i have done but i still have a problem:- Can you correct my mistakes? ------------------------------------------------------- create database
i have problem with classnofounderror
i have problem with classnofounderror   import java.sql.*; public class Tyagi { public static void main (String args[])throws SQLException { ResultSet rs; try { Class.forName
Advertisements
i have problem with classnofounderror
i have problem with classnofounderror   import java.sql.*; public class Tyagi { public static void main (String args[])throws SQLException { ResultSet rs; try { Class.forName
I have problem in my Project
I have problem in my Project  Dear Sir, i have problem in my project about Jtable i have EDIT JButton whenevery i was click on edit he is display all data from database but i want to select any row
i have a problem in spring - Spring
i have a problem in spring  spring Aop: how to configure proxyfactorybean in xml file for providing advices for one particular class
i have problem in that program - JavaMail
i have problem in that program  1. Write a multi-threaded Java... = pw; } public void run(){ try{ int i; for (i=1;i<10;i++){ int j; for(j=2; j<10; i++) { pw.write(f3+"\n"); f1 = f2
i have problem in that program sir - JavaMail
i have problem in that program sir  1.Develop multi-threaded echo server and a corresponding GUI client in Java
I have crude application
I have crude application   I have crude application, how to load into this roseindia.net
I have need to help
I have need to help  Write a program that, for four points A, B, C and P, draws a triangle formed by ABC and a small cross showing the position of P; and displays a line of text indicating which of the following three cases
What changes I have to do in php.ini file for file uploading?
What changes I have to do in php.ini file for file uploading?  What changes I have to do in php.ini file for file uploading
i have problem in that program to my assignment sir - JavaMail
i have problem in that program to my assignment sir   Develop a programmer's editor in Java that supports syntax-highlighting, compilation support, debugging support, etc
Hello Sir I Have problem with My Java Project - Java Beginners
Hello Sir I Have problem with My Java Project  Hello Sir I want Ur Mail Id To send U details and Project Source Code, plz Give Me Ur Mail Id
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select length(ename)||' charecters exist in '||initcap(ename)||'s name' as "names and length" from emp
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select initcap(ename),job from emp where substr(job,4,length(job,4,3)))='age
I have a small problem in my datagridview - Design concepts & design patterns
I have a small problem in my datagridview  i have datagridviewer in c#(platform) and i try that change cell beckground, this cell Should... the backcolor of individual cells please help me. Sorry for My English.(I am
I have doubt in jsp file.
I have doubt in jsp file.  I have doubt in jsp file. In a jsp file, there should be two buttons. One is start and other is stop. When we click.... Please can you help me with the code
Can I have multiple main() methods in the same class?
Can I have multiple main() methods in the same class?  Hi, Can I have multiple main() methods in the same class?   Hi, No, We cann't use multiple main() method within the same class. If we do this then the program
i have an ques. of advanced java
i have an ques. of advanced java  write a wap to implement AWT by login form
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program... reversedNumber = 0; for (int i = 0; i <= num; i...; reversedNumber = reversedNumber * 10 + r; i = 0
I developed a simple java web project in Struts now If I have to import the project in Eclipse Indigo how can I do it
I developed a simple java web project in Struts now If I have to import the project in Eclipse Indigo how can I do it   I developed a simple java web project in Struts now If I have to import the project in Eclipse Indigo how
I have only one day to visit the Jaipur..
I have only one day to visit the Jaipur..  Hi, I have only a day to travel in Jaipur ..hence, bit worried about what to see first
i have split a string by space ,done some operation and now how to properly order them for sending a mail in java or jsp - JSP-Servlet
i have split a string by space ,done some operation and now how to properly order them for sending a mail in java or jsp  Dear sir, I have... that is not properly ordered i.e see the following ///I typed a matter like this in a text
I have a doubt regarding action - Struts
, Please check Action Mapping in the struts-config.xml. If you have any problem...I have a doubt regarding action   hi, I have doubt regarding struts,I got response through jsp and once again it redirecting to action
In Java I have append to an existing string efficiently
In Java I have append to an existing string efficiently  Hi, In a Java program I have to append to a existing string more efficiently so that the performance of the application becomes maximum. What will be the best code
i have no programming knowledge is it possible for study java?
i have no programming knowledge is it possible for study java?  hello sir i have no programming knowledge is it possible to study java and jsp and servlet and struts.if it is then how i schedule for this and how to study
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.  could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project
I have to retrieve these data from the field table
I have to retrieve these data from the field table  Hi. I have... chennai,trichy,kanchipuram for a single record. I have to retrieve these data from... as single values like chennai as one value, trichy as one value. and i have
depending on the form name i have to display the message
depending on the form name i have to display the message  depending on the form name i have to display the message. for example, i have 3 jsp pages like contact us,suggest us, feed back and i have to use servlet, if user clicks
software or i have to write a code for this suff
convert windows picture or fax viewer file into ms word or pdf   sir i want to convert windows picture or fax viewer file into ms word or pdf so for this is i have to take help from the java code or any software is present
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
Advertisements
 

 

 

DMCA.com