Database Management (1)
Database Management (1)
CLASS-XII
3. You can't enter a value in the foreign key field of the related table
that doesn't exist in the primary key of the primary table.
4. However, you can enter a Null value in the foreign key, specifying
that the records are unrelated..
MySQL
–MySQL is an open source RDBMS which makes use of
SQL for ADDING, DELETING and MODIFYING data from
data bases.
Here, we can insert values without specifying column names provided the
order of values for columns should be same as in table.
Dropping a Table
• To drop a table in Database, following command is
mysql> DROP Table <Table Name>;
For ex -
mysql>drop table <Student>
A message will come saying- “Query OK” now if you want to
see the structure of the table you cant see because it has
already been deleted.
Modification in Table structure
• To modify structure of a table in Database,
following command is used-
mysql>ALTER TABLE <Table name> ADD/MODIFY(<Col>
<type(size)>, . . . .)
Viewing records
after deletion.
When both the tables have same field name, then to show a
field from particular table, use the following pattern to access a
field- <Table name>.<Field Name>
Ex- emp1.empcode
This is an example of Equi-
Join, in which columns are
compared for equality and it
is also an example of
Natural- Join, in which only
one of the identical columns
exists.
INNER JOIN