EXAM Flashcards
What do you have to do when you store something in LMC
You have to store it into a memory address with an integer value between 1 and 99
FIVE DAT 5 or 5 DAT FIVE
FIVE DAT 5
What should you do when branching in LMC
Put your first instruction on the same line as the line for example POSITIVE LDA X all needs to be on the same line
How do you declare a 1d array pseudocode(first way)?
array names[3]
names[0] = “Ahmad”
names[1] = “Ben”
names[2] = “Catherine
How do you declare a 1d array pseudocode(second way)?
array names[3] = [“Ahmad”, “Ben”, “Catherine”]
First way to declare 2d array
array scores[2][2]
scores[0][0] = 14
scores[0][1] = 80
scores[1][0] = 20
Scores[1][1] = 82
Second way to declare 2d array
array scores[2][2] = [[14, 80],[20, 82]]
How many elements would be in the array chores[3][3]
9
How to delete whole rows from sql
Do not use a where clause so all values will be deleted
How to delete specific rows from sql
Use where clause to specify conditions that need to be met
Can you delete specific columns from sql
No
What do you need to remember
How many bits to use
Two’s comp
First bit is negative if it is 1
Sign and mag
First bit just determines wether it is pos or negative
Subtracting values tc
Convert the right one to other sign
Adding negatives values
Do it normally
When talking about what a queery does, what do you say
From “whatever the table is called” and then put what it returns
How do you select multiple atributes in SQL
Put a comma between them
How do you delete a table
DROP TABLE Students
How do you delete a database
DROP DATABASE GuestHouse
Can you do OR in SQL
Yes
Can you do AND in SQL
Yes
How to do like
WHERE City LIKE “Ber%”, this means it stars with Ber, if it was before it would end in Ber and if it was on either side it would contain Ber
In the select clause, what do you do when there is two tables
Customers.FirstName, Orders.OrderDate