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

 
 


alhisnawy
Can you see what i have done because i did it but i still have problem
1 Answer(s)      3 years and 3 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),
);
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 Pages:
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 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 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 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 find that you have changed jobs many times so far. Why is it so?
I find that you have changed jobs many times so far. Why is it so... leave the job too soon, the way you have done with others. This might also indicate... the chances of coming across as a job hopper. For instance, if you have changed
When you look back on the position you held last, do you think you have done your best in it?
must have researched this company before coming for the interview. Can you tell me... systematic and analytical. I am positive that this must have helped you hire... on what you have seen and this way you sound sincere and believable
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 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
Still have the same problem--First Example of Struts2 - Struts
Still have the same problem--First Example of Struts2  Hi I tried the example in the link. But still I am getting the same problem like as I... Rajanikant  Hi Rajanikant, Please let me know how can I
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
File I/O
with "tAC" and ends with "->0|0|6" as you shall see in the text file i have posted below: here is the code to what i have done thank you looking forward... the text file then read it and write it into as a comma delimitade file. i have
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 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
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
How can I do it? .click();
How can I do it? .click();  I have a very unusual problem. I want...("a"); x.click(); </script> So it's click on an element witch one Id's is "a", but I want that it make mouseup in this element. How can I do it, because if I write
which tag i have to use - Java Server Faces Questions
. for that what tag i have to use.please help me. Thanks, Puppy.  use...which tag i have to use  Hi All, I have one Question Regadding Jsf. when i clicked on one dropdown list box.when i select one item it should
The app was not installed on iphone because its resources have been modified
resources have been modified" What is the solution? Thanks   Hi, You have...The app was not installed on iphone because its resources have been modified  Hi, I am getting following error while my client is installing my
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
i can not connect to database in servlet - JSP-Servlet
with Done response at the bottem of the page(status bar). By the way ,I have...i can not connect to database in servlet  Hi I am following the tutorial in this site on servlet and JDBC. I did all the proccedure for connecting
i can not connect to database in servlet - JSP-Servlet
with Done response at the bottem of the page(status bar). By the way ,I have...i can not connect to database in servlet  Hi I am following the tutorial in this site on servlet and JDBC. I did all the proccedure for connecting
This is what i need in this Question - Java Beginners
This is what i need in this Question  You are to choose between two... this: Which procedure should you choose? why you have chose it? just... because may be the value of the empty array can be the smallest integer of the empty
still error
any action on button then use the following code: Suppose, you have created...){ //--------here you can use your insert query------ } }); Thanks   actually m...still error  public NewJFrame() { initComponents(); try
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
How to update record to database? I have trouble with the following code
How to update record to database? I have trouble with the following code  I have written the update statement but it still not work to update the record,what is the missing of the following code ?I need help,thankyou <?php
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
pdf from i report
pdf from i report  I have a problem again with my report, i use I.... but in rtf format data can view. or can icon save like this to be dissapear/not viewer in Jasperviewer...., thank you, hendra
I have posted a number of question but no one has answered?
I have posted a number of question but no one has answered?  No one has responded for ten days now. However my first question was answered on the same day. Is there a limit to the number of questions you can ask or am I doing
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 got error while compiling simple tag handler
i have got error while compiling simple tag handler   javac.servlet.jsp not found! tell me what are the jar files required to run simple tag handler class   The package you have used javac.servlet.jsp does not exist
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 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
hello there i need help
transaction? thats the problem. I dont know how to start this program because... OPtions: once i have chosen an option then i should proceed here if i choose b: YOur Balance is __ if i chose D: Enter you deposit amount: if i choose W
Programming: Hammurabi I - Solution
Java NotesProgramming: Hammurabi I - Solution Solution The following two source files are a solution to the Hammurabi I programming problem...++; } JOptionPane.showMessageDialog(null, "We have survived because of your
problem i coding
problem i coding  i have a problem in coding a combobox containing a number of *.java program on click one of them that program should compile and run and display the result in other window
JSP and Servlet did not run - JSP-Servlet
what I wanted. Anyone can trace what I made wrong here... Thanks  Hi, Thanks for your reply - I noticed that you have changed...JSP and Servlet did not run  I tried to run this program but when I
Can I pass a
Can I pass a   Suppose I have servlet named Name.java and there is a variable String name holding a value "Roseindia". I have collected the value to Getname.jsp via ajax. Now how can I pass this value to scriplet without page
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..   hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work
what should i do next?? - Java Beginners
what should i do next??  I know java basics.actully i passed the SCJP exam.Then now i have no idea about what should i do next.I like to come to the web development.I want to know which one i should study first.JSP or servlet
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 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
How can I protect my database password ?
in as plain text. What can I do to protect my passwords...How can I protect my database password ?   How can I protect my... a database over the internet. I have concerns about the security of the database
Still getting the http 404 error - Java Beginners
= ? AND password = ?"; Can I know why you have put username whereby my name in the form... that login page cannot be found. Hope that you can advise me what to do...Still getting the http 404 error  Dear experts, I refer
Java I/O From the Command Line
Java I/O From the Command Line In this section we will learn about the I/O from the command line in Java. Several times you can see that the programs runs... of the console object returns null then the console operation can not be done

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.