Computer Science, asked by charshuchhabda563, 5 months ago

Answer the following questions.
1. What is the use of using a database?
2. Compare Primary key and Foreign key in a table?
3. What is a Table in a database?



Answers

Answered by shristisuman567
1
  1. A primary key is a field in a table which uniquely identifies each row/record in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values.
  2. solution of your question is in image provided.
  3. A table is a collection of related data held in a table format within a database. It consists of columns and rows. In relational databases, and flat file databases, a table is a set of data elements using a model of vertical columns and horizontal rows, the cell being the unit where a row and column intersect.

Hope it helps

Attachments:
Answered by harneetmakkad27
2

Answer:

1.

•Databases can store very large numbers of records efficiently (they take up little space).

•It is very quick and easy to find information.

It is easy to add new data and to edit or delete old data.

•Data can be searched easily, eg 'find all Ford cars'.

•Data can be sorted easily, for example into 'date first registered' order.

•Data can be imported into other applications, for example, a mail-merge letter to a customer saying that an MOT test is due.

•More than one person can access the same database at the same time - multi-access.

•Security may be better than in paper files

2.

S.NO. PRIMARY KEY FOREIGN KEY

1 A primary key is used to ensure data in the specific column is unique.

A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables.

2 It uniquely identifies a record in the relational database table.

It refers to the field in a table which is the primary key of another table.

3 Only one primary key is allowed in a table.

Whereas more than one foreign key are allowed in a table.

4 It is a combination of UNIQUE and Not Null constraints.

It can contain duplicate values and a table in a relational database.

5 It does not allow NULL values.

It can also contain NULL values.

6 Its value cannot be deleted from the parent table.

Its value can be deleted from the child table.

7 It constraint can be implicitly defined on the temporary tables.

It constraint cannot be defined on the local or global temporary tables

( bolder letters are foreign key and simple letters are the primary key make sure you get that right!)

3. Tables are database objects that contain all the data in a database. In tables, data is logically organized in a row-and-column format similar to a spreadsheet. Each row represents a unique record, and each column represents a field in the record

hope it helped.

Similar questions