4.10: section 11: databases and software development Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

define an attribute

A

-a piece of information which determines the properties of a field or tag in a database or a string of characters in a display.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define primary key

A

-an attribute that provides an unique identifier for every entity in a database table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

define composite primary key

A

-a primary key made up of more than one attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

define foreign key

A
  • links tables via a shared attribute

- the attribute must be a primary key in one table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is normalisation

5 points

A
  • the process of coming up with the best possible design for a relational database to allow faster searching and sorting
  • no data is duplicated
  • data is consistent across tables
  • flexible structure allowing as many entries as desired
  • user is able to make complex queries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is first normal form

A
  • no repeating attributes or groups of attributes

- the database data is atomic (meaning no single column contains more than one value)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is second normal form

A
  • no repeating attributes or groups of attributes

- no partial dependencies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is third normal form

A
  • no repeating attributes or groups of attributes
  • no partial dependencies
  • no non key dependencies
  • all attributes are dependent on the key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

why are databases normalised

A
  • easier to maintaining and modifying the database
  • faster sorting and searching
  • accidental deletion of records is prevented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how do you write a select sql command

A

SELECT attribute FROM table WHERE condition ​ORDER BY ASC/DESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how do you write an update sql command

A

UPDATE table SET attribute = value WHERE = attribute = value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how do you write a delete sql command

A

DELETE FROM table WHERE condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how do you write an insert sql command

A

INSERT INTO table (column1, column 2 , …) VALUES (vaule1, value2 , …)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how do you define a table with sql

A
CREATE TABLE Artworks 
(Title VARCHAR(225),
 Artist VARCHAR(255), 
Date YEAR, 
PRIMARY KEY (Title, Artist))
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how do you do an inner join on a sql select statement

A

SELECT *
FROM table1 INNER JOIN table2
ON table1.column_name= table2.column_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly