Review - PowerPoint PPT Presentation

About This Presentation
Title:

Review

Description:

Review Which of the following SQL commands would be used to remove only the data from a table named STUDENT while leaving the table structure intact? – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 74
Provided by: Dell92
Category:
Tags: customer | review | table | voice

less

Transcript and Presenter's Notes

Title: Review


1
Review
2
  • The number of entity classes in a relationship is
    know as the relationships
  • degree
  • maximum cardinality
  • cordiality
  • minimum cardinality

3
  • In Hierarchical database model _______ are used
    to relate parent and children
  • No relation sign
  • Dollars
  • Pointers
  • Line

4
  • A database is an organized collection of ______
    related data
  • not
  • badly
  • logically
  • physically

5
  • Which of the following types of data can be
    stored in a database ?
  • Voice
  • All of the above
  • Letters
  • Numbers

6
  • In a database system ,all the application data is
    stored in a single facility called the
  • database
  • CPU
  • Hard drive
  • DBMS

7
  • When more them on attribute is used to determine
    unique types within a table , it is called a
  • Foreign key
  • Atomic field
  • Composite key
  • Foreign key and atomic field

8
  • What element of a database is a collection of
    data in rows and columns?
  • Table
  • Pages
  • Data type
  • Extents

9
  • The component of a database that makes is self
    describing is the
  • data set
  • library
  • metadata
  • related tabled

10
  • The _______ contains data descriptions and
    defines the name ,data type ,and length of each
    field in the database
  • data field
  • data table
  • data dictionary
  • data record

11
  • these are one piece of data.
  • table
  • fields
  • queries
  • records

12
  • A field in a table has the value NULL . This can
    mean the data is
  • missing
  • nonexistent
  • not applicable
  • all of the others

13
  • A composite primary key can be defined the
    CONSTRAINT phrase in which SQL commands?
  • Changed Table
  • Create Table
  • Build Table
  • Modify Table

14
  • Which of the following terms is synonymous with
    tuple?
  • Row
  • attribute
  • table
  • field

15
  • All of the following are advantages of using a
    database , EXCEPT?
  • Data integrity
  • Flexible use of data
  • Information sharing
  • Data redundancy

16
  • A telephone number would be stories in a. field
    in a database?
  • Date
  • Computed
  • Memo
  • Text

17
  • What element of database is a collection of data
    in row and column?
  • Datatype
  • Pages
  • Table
  • extends

18
  • Which of the following functions does a database
    application program perform?
  • Delete data
  • Retrive data
  • All of the above
  • Create data

19
  • What must be installed along with SQL server 2000
    so that web page developers can access data by
    using XPath query?
  • Named pipes
  • IIS services
  • SMTP service
  • IPX/SPX

20
  • Which of the following is not a relationship
    type
  • Many to many
  • One to one
  • One to many
  • Many to one

21
  • Data processed in a say that increases a user's
    knowledge is
  • text.
  • hyperlink.
  • information
  • graphics.

22
  • The way an end user views the database is
    called_________?
  • Conceptual Schema
  • Internal Schema
  • Logical Scheme
  • External Schema

23
  • Which of the following terms is synonymous with
    "relation"?
  • A) Attribute
  • B) Table
  • C) Record
  • D) Tuple

24
  • When the primary key of one relation is placed
    into a second relation, it is called a
  • A) field key.
  • B) referential integrity.
  • C) foreign key.
  • D) candidate key.

25
  • The DOMAIN of an attribute is which of the
    following?
  • a. The range of values that the attribute is
    allowed to take.
  • b. The type of the attribute.
  • c. Which tables the attribute is allowed to be
    in.
  • d. More than one of the above.

26
  • To store text data that may be very long, use a
    ____________ field in a database.
  • a. memo
  • b. text
  • c. data
  • d. long

27
  • A database is an organized collection of _____
    related data.
  • A)  logically
  • B)  physically
  • C)  not
  • D)  badly

28
  • Each column in a table represent a(n) _____ of an
    entity.
  • A) description
  • B) attribute
  • C) byte
  • D) logical element

29
  • A primary key in a table
  • a. must be different from foreign keys in another
    table
  • b. can be the same value as other primary key
    values in the same table
  • c. must not contain NULL
  • d. must be different from a primary key in
    another table

30
  • Which of the following is NOT an advantage of
    database systems?
  • A) Redundant data
  • B) Program-data independence
  • C) Better data quality
  • D) Reduced program maintenance

31
  • Nulls, if used improperly, can create problems
    because they can represent
  • a. An unknown attribute value.
  • b. A known, but missing, attribute value.
  • c. A "not applicable" condition.
  • d. All of the above

32
  • SELECT C1.CustName, C1.SalesRepNo
  • FROM CUSTOMER C1
  • the "C1" is called a(n) ________________ .
  • a.) term
  • b.) alias
  • c.) convention
  • d.) phrase

33
  • Mo hinh ER

34
  • Miêu ta? mô?t thu?c thê? cu? thê? nao do, go?i
    la ______________.
  • Lop thu?c thê? (entity class)
  • Môi liên kêt thu?c thê? (entity relationship)
  • Thê? hiê?n thu?c thê? (entity instance)
  • Thuô?c tinh thu?c thê? (entity attribute)
  • Không co phuong an tra? loi.

35
  • Thuô?c tinh co thê? la thuô?c tinh
    ____________.
  • a.) Phuc ho?p (composite)
  • b.) Phân tu? (element)
  • c.) Ða tri? (multi-value)
  • d.) Ca? a va c
  • e.) Ca? b va c

36
  • Thuô?c tinh phuc ho?p (composite attribute) la
    thuô?c tinh .
  • a.) Ða tri? (multi-value)
  • b.) Mô t? m?t d?c trung c?a m?i quan h?
  • c.) Bao g?m m?t nhóm các thu?c tính
  • d.) Ðu?c tính t?i th?i gian ch?y
  • e.) Khoa nhâ?n da?ng

37
  • Chuy?n t? ERD sang quan h?
  • a) SinhVien(MaSV, HoTen,Phai, NgaySinh, NgoaiNgu)
  • b) SinhVien(MaSV, HoTen,Phai, NgaySinh, NgoaiNgu)
  • c) SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • NgoaiNgu_SinhVien(MaSV, NgoaiNgu)
  • d) SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • NgoaiNgu_SinhVien(MaSV, NgoaiNgu)

38
  • Chuy?n t? ERD sang quan h?
  • SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • MonHoc(MaMH, TenMH, SoTiet, SoTien, MaSV)
  • B. SinhVien(MaSV, HoTen,Phai, NgaySinh, MaMH)
  • MonHoc(MaMH, TenMH, SoTiet, SoTien, MaSV)
  • C. SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • MonHoc(MaMH, TenMH, SoTiet)
  • DangKy(MaSV,MaMH, SoTien)
  • D. SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • MonHoc(MaMH, TenMH, SoTiet, SoTien)
  • DangKy(MaSV,MaMH)

39
  • Chuy?n t? ERD sang quan h?
  • SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • L?p(MaLop, TenLop, SiSo, MaSV)
  • B. SinhVien(MaSV, HoTen,Phai, NgaySinh, MaLop)
  • L?p(MaLop, TenLop, SiSo)
  • C. SinhVien(MaSV, HoTen,Phai, NgaySinh)
  • L?p(MaLop, TenLop, SiSo)
  • H?c(MaSV, Malop)
  • D. SinhVien(MaSV, HoTen,Phai, NgaySinh, MaLop)
  • L?p(MaLop, TenLop, SiSo, MaSV)

40
  • 10. _____ c?a m?t th?c th? tr? thành các c?t
    trong m?t b?ng c?a co s? d? li?u.
  • Các thu?c tính
  • Các b? (tuple)
  • Các file d? li?u
  • Các lu?c d? quan h?

41
  • Quan h? nhi?u-nhi?u (n-n) trong lu?c d? ER có th?
    du?c trình bày trong mô hình quan h? b?i
  • M?t khoá chính
  • M?t thu?c tính duy nh?t
  • M?t mi?n giá tr?
  • M?t quan h? v?i hai khoá ngo?i

42
  •  
  • Khách Hàng(Mã Kh, Tên Kh, Ð?a Ch?, s? nhà, Ðu?ng,
    Phu?ng, Qu?n, Thành Ph?)
  • Khoá chính là Mã KH
  •  
  • B. Khách Hàng(Mã Kh, Tên Kh, s? nhà, Ðu?ng,
    Phu?ng, Qu?n, Thành Ph?)
  • Khoá chính là Mã KH
  •  
  • C. Khách Hàng(Mã Kh, Tên Kh, Ð?a Ch?, Thành Ph?)
  • Khoá chính là Mã KH
  •  
  • D. Khách Hàng(Mã Kh, Tên Kh, Mã Ð?a Ch?, Thành
    Ph?)

43
  • Hãy chuy?n t? mô hình ER sang lu?c d? các quan
    h??
  •  
  • EMPLOYEE(Employee_ID, Employee_Name,
    Employee_Address)
  • Khoá chính là Employee_ID
  • EMPLOYEE_SKILL(Employee_ID, Employee_Name,
    Skill)
  • Khoá chính là Employee_ID, Skill
  •  
  • B. EMPLOYEE(Employee_ID, Employee_Name,
    Employee_Address, Skill)
  • Khoá chính là Employee_ID, Skill
  •  
  • C. EMPLOYEE(Employee_ID, Employee_Name,
    Employee_Address)
  • Khoá chính là Employee_ID
  • EMPLOYEE_SKILL(Employee_ID, Skill)
  • Khoá chính là Employee_ID, Skill
  •  

44
  • Chuy?n d?i t? ERD sang các quan h? c?a hình sau
  • Nhà Cung C?p(Mã NCC, Tên NCC, Ð?a Ch?)
  • Khoá Chính là Mã NCC
  • S?n Ph?m(Mã SP, Tên SP, Ðon Giá, S? lu?ng, Mã
    NCC)
  • Khoá Chính là Mã SP
  •  
  • B. Nhà Cung C?p(Mã NCC, Tên NCC, Ð?a Ch?, Mã SP)
  • Khoá Chính là Mã NCC
  • S?n Ph?m(Mã SP, Tên SP, Ðon Giá)
  • Khoá Chính là Mã SP
  •  
  • C. Nhà Cung C?p(Mã NCC, Tên NCC, Ð?a Ch?)
  • Khoá Chính là Mã NCC
  • S?n Ph?m(Mã SP, Tên SP, Ðon Giá)
  • Khoá Chính là Mã SP
  • Cung ?ng (Mã NCC, Mã SP, S? lu?ng)
  • Khoá chính là Mã NCC, Mã SP
  •  

45
  • Khi nhiêu hon mô?t thuô?c tinh dung dê? xac
    di?nh duy nhât cac bô? trong mô?t ba?ng, thi
    no duo?c go?i la
  • Khoa ngoa?i (Foreign key)
  • Truong nguyên tô (Atomic field)
  • Khoa phuc ho?p (Composite key)
  • Khoa ngo?ai va truong nguyên tô (Foreign key
    and atomic field)

46
  • Thanh phân cu?a co so? du liê?u ma duo?c ta?o
    thanh bang cach mô ta? chinh no, thi duo?c
    go?i la
  • Tâ?p du liê?u (data set)
  • Thu viê?n (library)
  • Siêu du liê?u (Metadata)
  • Cac ba?ng quan hê? (related tabled)

47
  • X? lý d? li?u dê? tang su? hiê?u biêt c?a ngu?i
    dùng, go?i la
  • Van ba?n (text).
  • Siêu liên kêt (hyperlink).
  • Thông tin (information)
  • Ðô ho?a (graphics).

48
  • Tu nao cho bên duoi thi dông nghia voi
    "relation"?
  • A) Attribute
  • B) Table
  • C) Record
  • D) Tuple

49
  • Khi khóa chính c?a m?t m?i quan h? du?c d?t vào
    m?t quan h? th? hai, nó du?c g?i là m?t
  • A) Truong khoa (field key).
  • B) Toàn v?n tham chi?u (referential integrity)
  • C) Khoa ngoa?i (foreign key).
  • D) Khoa du? tuyê?n (candidate key).

50
  • Miên (DOMAIN) c?a m?t thu?c tính dó là?
  • a. Ph?m vi c?a các giá tr? mà thu?c tính nay
    du?c phép.b. Các lo?i thu?c tính.c. Cac b?ng
    chua thu?c tính nay.d. Nhi?u hon m?t trong
    nh?ng trên.

51
  • M?i c?t trong b?ng tuong ung voi _____ c?a m?t
    th?c th?.
  • A) mô t? (description)B) thu?c tính
    (attribute)C) byteD) Phân tu? luâ?n ly
    (logical element)

52
  • Mô?t toàn v?n ma d?m b?o r?ng các giá tr? trong
    khoa ngoa?i pha?i so trung v?i giá tr? c?a khóa
    chính tuong ?ng?
  • a) Toàn v?n vê miên gia tri? (Domain
    integrity).b) Toàn v?n thu?c thê? (Entity
    integrity)c) Toàn v?n do ngu?i dùng d?nh nghia
    (User-defined integrity). d) Toan ve?n tham
    chi?u (Referential intergrity)

53
  • Mô?t thuô?c tinh (cac thuô?c tinh) dung dê?
    xac di?nh duy nhât mô?t bô? trong mô?t quan hê?
    thi duo?c go?i la
  • Khoa du? tuyê?n va khoa chinh (Candidate key
    va primary key)
  • Khoa chinh (Primary key)
  • Khoa du? tuyê?n (Candidate key)
  • Khoa ngoa?i (Foreign key)

54
  • M?t nhân viên qu?n lý m?t nhân viên khác là ví d?
    t?t nh?t c?a?
  • Th?c th? ph? thu?c
  • Quan h? ba ngôi
  • Quan h? m?t ngôi
  • Quan h? hai ngôi

55
  • S? phân bi?t gi?a d? li?u và thông tin nào sau
    dây là chính xác nh?t?
  • D? li?u và thông tin v? b?n ch?t là hoàn toàn
    gi?ng nhau
  • D? li?u du?c luu tr? ? m?c thô, thông tin là dã
    du?c qua x? lý
  • Không có s? phân bi?t gi?a d? li?u và thông tin
  • L?a ch?n khác

56
  • C?u trúc c?a m?t mô hình quan h? du?c d?nh nghia
    b?i
  • Quan h?, b? và thu?c tính
  • B?ng, dòng và c?t
  • T?p tin, m?u tin và tru?ng
  • T?t c? d?u dúng

57
  • Ð?i v?i m?t m?i quan h? du?c coi là m?t m?i quan
    h? nh? phân (hai ngôi), nó ph?i dáp ?ng các di?u
    ki?n nao sau dây?
  • a.) No pha?i liên kêt voi chinh xac hai
    thu?c thê?.
  • b.) No pha?i co luo?ng sô (ba?n sô) tôi da
    la 11.
  • c.) No pha?i co luo?ng sô (ba?n sô) tôi da
    la 1N.
  • d.) Ca? a va b
  • e.) Ca? a va c

58
  • Thuô?c tinh phuc ho?p (composite attribute) la
    thuô?c tinh .
  • a.) Ða tri? (multi-value)
  • b.) Mô t? m?t d?c trung c?a m?i quan h?
  • c.) Bao g?m m?t nhóm các thu?c tính
  • d.) Ðu?c tính t?i th?i gian ch?y
  • e.) Khoa nhâ?n da?ng

59
  • Mô?t khoa nhâ?n da?ng (identifier) co thê? la
  • a.) Phuc ho?p (composite)
  • b.) Duy nhât (unique)
  • c.) Thuô?c tinh don (single attribute)
  • d.) Không duy nhât (non-unique)
  • e.) Tât ca? cac phuong an trên.

60
  • Phân tu? nao sau dây không pha?i la thanh
    phân trong mô hinh E-R
  • a.) Khoa nhâ?n da?ng (identifiers)
  • b.) Cac thu?c thê? (entities)
  • c.) Cac dôi tuo?ng (objects)
  • d.) Cac thuô?c tinh (attributes)
  • e.) Cac môi liên kêt (relationships)
  •  

61
  • SQL
  • (Structured Query Language)

62
  • Given the table STUDENT(StudentID, Name,
    Advisor), which of the following SQL statements
    would be used to change the value of the Advisor
    field to 'Smith' for all rows in the STUDENT
    table?
  • A) UPDATE STUDENT SET Advisor 'Smith'
  • B) MODIFY STUDENT SET Advisor 'Smith'
  • C) MODIFY Advisor SET STUDENT 'Smith'
  • D) UPDATE Advisor 'Smith'

63
  • Which of the following SQL commands would be used
    to remove both the data and the table structure
    of a table named STUDENT?
  • A) DROP TABLE STUDENT
  • B) DELETE TABLE STUDENT
  • C) REMOVE TABLE STUDENT
  • D) DELETE FROM STUDENT

64
  • Given the table CUSTOMER(CustID, Name, PhoneNum,
    AcctBalance), what is the standard SQL query
    phrase to retrieve data for customers with an
    account balance greater than 50?
  • A) WHERE CUSTOMER-AcctBalance gt 50
  • B) HAVING AcctBalance gt 50
  • C) WHERE AcctBalance gt 50
  • D) WHERE (Customer-AcctBalance gt 50)

65
  • Given the tables
  • STUDENT(StudentID, StudentName, AdvisorID) and
  • ADVISOR(AdvisorID, AdvisorName, Office, Phone),
    which of the following SQL statements would be
    used to implant a join between the two tables?
  • A) WHERE STUDENT MATCH ADVISOR
  • B) WHERE STUDENT.AdvisorID MATCH
    ADVISOR.AdvisorID
  • C) WHERE STUDENT JOIN ADVISOR ON
    STUDENT.AdvisorID ADVISOR.AdvisorID
  • D) WHERE STUDENT JOIN ADVISOR

66
  • Which of the following SQL commands would be used
    to remove only the data from a table named
    STUDENT while leaving the table structure intact?
  • A) DROP TABLE STUDENT
  • B) DELETE TABLE STUDENT
  • C) REMOVE TABLE STUDENT
  • D) DELETE FROM STUDENT

67
(No Transcript)
68
  • You are designing a database that will contain
    customer orders. Customers will be able to order
    multiple products each time they place an order.
    You review the database design, which is shown in
    the exhibit. You want to promote quick response
    times for queries and minimize redundant data.
    What should you do?
  • A. (I) Create a new order table named
    OrderDetail.
  • Add OrderID, ProductID, and Quantity columns to
    this table.
  • B. Create a composite PRIMARY KEY constraint on
    the OrderID and ProductID columns of the Orders
    table.
  • C. (II) Remove the ProductID and Quantity
    columns from the Orders table.
  • D. Both A and C

69
  • Which SQL keyword is used to eliminate duplicate
    rows in the results of a SQL SELECT query?
  • A) UNIQUE
  • B) SORT
  • C) ORDER BY
  • D) DISTINCT

70
  • Conditions after the WHERE require single quotes
    around the values for columns that have which
    data type?
  • A) Char
  • B) VarChar
  • C) Integer
  • D) Both A and B

71
  • Which symbol is used in standard SQL as a
    wildcard to represent a single, unspecified
    character?
  • A) (percent sign)
  • B) ! (exclamation mark)
  • C) _ (underscore)
  • D) ? (question mark)

72
  • Given the table CUSTOMER(CustID, Name, PhoneNum,
    AcctBalance), what is the standard SQL query
    phrase to retrieve the Name and Phone Number of
    customers?
  • A) SELECT CUSTOMER-Name AND CUSTOMER-PhoneNum
  • B) SELECT (CUSTOMER-Name AND CUSTOMER-PhoneNum)
  • C) SELECT Name, PhoneNum
  • D) SELECT (Name, PhoneNum)

73
  • Given the table STUDENT(StudentID, Name,
    Advisor), which of the following SQL statements
    would be used to add new student data to the
    STUDENT table?
  • A) INSERT DATA STUDENT SET StudentID123,
    Name'Jones', Advisor'Smith'
  • B) INSERT INTO STUDENT VALUES (123, 'Jones',
    'Smith')
  • C) INSERT INTO STUDENT (New Student Data) VALUES
    (123, 'Jones', 'Smith')
  • D) INPUT DATA STUDENT SET StudentID123, Name'
    Jones', Advisor'Smith'
Write a Comment
User Comments (0)
About PowerShow.com