Practical Database Programming With Visual C#.NET- P2
Số trang: 50
Loại file: pdf
Dung lượng: 1.29 MB
Lượt xem: 11
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tham khảo tài liệu practical database programming with visual c#.net- p2, công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
Practical Database Programming With Visual C#.NET- P2 2.11 Create Oracle 10g XE Sample Database 73Figure 2.51 Completed LogIn table.length of the string depends on the number of real letters entered by the user. The datatypes for all columns are VARCHAR2 with one exception, which is the phone columnthat has a CHAR type with an upper bound of 12 letters since our phone numbers arecomposed of 10 digits, and we can extend this length to 12 with two dashes. For all othercolumns, the length varies with the different information, so the VARCHAR2 is selectedfor those columns. The finished design view of your Faculty table is shown in Figure 2.52. You need tocheck the Not Null checkbox for the faculty_id column since we selected this column asthe primary key for this table. Click on the Next button to go to the next page to add the primary key for this table,which is shown in Figure 2.53. Check the Not Populated from the primary key list since we don’t want to use anySequence object to automatically generate a sequence of numeric numbers as our primarykey, and then select the FACULTY_ID(VARCHAR2) from the Primary Key textbox.In this way, the faculty_id column is selected as the primary key for this table. Keep theComposite Primary Key box untouched since we do not have that kind of key in thistable, and click on the Next button to go to the next page. Since we have not created all other tables to work as our reference tables for theforeign key, click on Next to continue, and we will do the foreign key for this table later.Click on the Finish button to go to the Confirm page. Finally click on the Create buttonto create this new Faculty table. Your completed columns in the Faculty table are shownin Figure 2.54.74 Chapter 2 Introduction to DatabasesFigure 2.52 Finished design view of the Faculty table.Figure 2.53 Opened Primary Key window. 2.11 Create Oracle 10g XE Sample Database 75 Figure 2.54 Completed columns in the Faculty table.Table 2.24 Data in the Faculty Table faculty_id faculty_name office phone college title emailA52990 Black Anderson MTC-218 750-378-9987 Virginia Tech Professor banderson@college.eduA77587 Debby Angles MTC-320 750-330-2276 University of Chicago Associate Professor dangles@college.eduB66750 Alice Brown MTC-257 750-330-6650 University of Florida Assistant Professor abrown@college.eduB78880 Ying Bai MTC-211 750-378-1148 Florida Atlantic University Associate Professor ybai@college.eduB86590 Satish Bhalla MTC-214 750-378-1061 University of Notre Dame Associate Professor sbhalla@college.eduH99118 Jeff Henry MTC-336 750-330-8650 Ohio State University Associate Professor jhenry@college.eduJ33486 Steve Johnson MTC-118 750-330-1116 Harvard University Distinguished Professor sjohnson@college.eduK69880 Jenney King MTC-324 750-378-1230 East Florida University Professor jking@college.edu Now click on the Data object tool to add the data into this new table. Click on the Insert Row button to add all rows that are shown in Table 2.24 into this table. Click on the Create and Create Another button when the first row is done, and con- tinue to create all rows with the data shown in Table 2.24. You may click on the Create button for your last row. Your finished Faculty table should match the one shown in Figure 2.55. 2.11.2.3 Create Other Tables In a similar way, you can continue to create the following three tables: Course, Student, and StudentCourse based on the data shown in Tables 2.25, 2.26, and 2.27.76 Chapter 2 Introduction to DatabasesFigure 2.55 Finished Faculty table. The data types used in the Course table are: • course_id: VARCHAR2(10)—primary Key • course: VARCHAR2(40) • credit: NUMBER(1, 0)—precision = 1, scale = 0 (1-bit integer) • classroom: CHAR(6) • schedule: VARCHAR2(40) • enrollment: NUMBER(2, 0)—precision = 2, scale = 0 (2-bit integer) • faculty_id: VARCHAR2(10) The data types used in the Student table are: • student_id: VARCHAR2(10)—primary Key • student_name: VARCHAR2(20) • gpa: NUMBER(3, 2)—precision = 3, scale = 2 (3-bit floating point data with 2-bit after the decimal point) • credits: NUMBER(3, 0)—precision = 3, scale = 0 (3-bit integer) • major: VARCHAR2(40) • schoolYear: VARCHAR2(20) • email: VARCHAR2(20) The data types used in the StudentCourse table are: • s_course_id: NUMBER(4, 0)—precision = 4, scale = 0 (4-bit integer) primary key • student_id: VARC ...
Nội dung trích xuất từ tài liệu:
Practical Database Programming With Visual C#.NET- P2 2.11 Create Oracle 10g XE Sample Database 73Figure 2.51 Completed LogIn table.length of the string depends on the number of real letters entered by the user. The datatypes for all columns are VARCHAR2 with one exception, which is the phone columnthat has a CHAR type with an upper bound of 12 letters since our phone numbers arecomposed of 10 digits, and we can extend this length to 12 with two dashes. For all othercolumns, the length varies with the different information, so the VARCHAR2 is selectedfor those columns. The finished design view of your Faculty table is shown in Figure 2.52. You need tocheck the Not Null checkbox for the faculty_id column since we selected this column asthe primary key for this table. Click on the Next button to go to the next page to add the primary key for this table,which is shown in Figure 2.53. Check the Not Populated from the primary key list since we don’t want to use anySequence object to automatically generate a sequence of numeric numbers as our primarykey, and then select the FACULTY_ID(VARCHAR2) from the Primary Key textbox.In this way, the faculty_id column is selected as the primary key for this table. Keep theComposite Primary Key box untouched since we do not have that kind of key in thistable, and click on the Next button to go to the next page. Since we have not created all other tables to work as our reference tables for theforeign key, click on Next to continue, and we will do the foreign key for this table later.Click on the Finish button to go to the Confirm page. Finally click on the Create buttonto create this new Faculty table. Your completed columns in the Faculty table are shownin Figure 2.54.74 Chapter 2 Introduction to DatabasesFigure 2.52 Finished design view of the Faculty table.Figure 2.53 Opened Primary Key window. 2.11 Create Oracle 10g XE Sample Database 75 Figure 2.54 Completed columns in the Faculty table.Table 2.24 Data in the Faculty Table faculty_id faculty_name office phone college title emailA52990 Black Anderson MTC-218 750-378-9987 Virginia Tech Professor banderson@college.eduA77587 Debby Angles MTC-320 750-330-2276 University of Chicago Associate Professor dangles@college.eduB66750 Alice Brown MTC-257 750-330-6650 University of Florida Assistant Professor abrown@college.eduB78880 Ying Bai MTC-211 750-378-1148 Florida Atlantic University Associate Professor ybai@college.eduB86590 Satish Bhalla MTC-214 750-378-1061 University of Notre Dame Associate Professor sbhalla@college.eduH99118 Jeff Henry MTC-336 750-330-8650 Ohio State University Associate Professor jhenry@college.eduJ33486 Steve Johnson MTC-118 750-330-1116 Harvard University Distinguished Professor sjohnson@college.eduK69880 Jenney King MTC-324 750-378-1230 East Florida University Professor jking@college.edu Now click on the Data object tool to add the data into this new table. Click on the Insert Row button to add all rows that are shown in Table 2.24 into this table. Click on the Create and Create Another button when the first row is done, and con- tinue to create all rows with the data shown in Table 2.24. You may click on the Create button for your last row. Your finished Faculty table should match the one shown in Figure 2.55. 2.11.2.3 Create Other Tables In a similar way, you can continue to create the following three tables: Course, Student, and StudentCourse based on the data shown in Tables 2.25, 2.26, and 2.27.76 Chapter 2 Introduction to DatabasesFigure 2.55 Finished Faculty table. The data types used in the Course table are: • course_id: VARCHAR2(10)—primary Key • course: VARCHAR2(40) • credit: NUMBER(1, 0)—precision = 1, scale = 0 (1-bit integer) • classroom: CHAR(6) • schedule: VARCHAR2(40) • enrollment: NUMBER(2, 0)—precision = 2, scale = 0 (2-bit integer) • faculty_id: VARCHAR2(10) The data types used in the Student table are: • student_id: VARCHAR2(10)—primary Key • student_name: VARCHAR2(20) • gpa: NUMBER(3, 2)—precision = 3, scale = 2 (3-bit floating point data with 2-bit after the decimal point) • credits: NUMBER(3, 0)—precision = 3, scale = 0 (3-bit integer) • major: VARCHAR2(40) • schoolYear: VARCHAR2(20) • email: VARCHAR2(20) The data types used in the StudentCourse table are: • s_course_id: NUMBER(4, 0)—precision = 4, scale = 0 (4-bit integer) primary key • student_id: VARC ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkTài liệu liên quan:
-
52 trang 433 1 0
-
24 trang 359 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 320 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 310 0 0 -
74 trang 303 0 0
-
96 trang 297 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 291 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 285 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 277 0 0 -
Tài liệu hướng dẫn sử dụng thư điện tử tài nguyên và môi trường
72 trang 270 0 0