freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

分布式數(shù)據(jù)庫sql語句(參考版)

2024-10-22 11:52本頁面
  

【正文】 } Exercise Write the following queries, based on the following database example Movie(title, year, length, inColor, studioName, producerC) StarsIn(movieTitle, movieYear, strName) MovieStar(name, address, gender, birthdate) MovieExec(name, address, cert, Worth) Studio(name, address, presC) Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, launched) Battles(name, date) Outes(ship, battle,result) In SQL. 1. Find Sandra Bullock’s birthdate 2. Find all executives worth at least $10,000,000 3. Find all the stars who either are male or live in Malibu stars appeared in movies produced by MGM in 1995? 5. Who is the president of MGM studio? 6. Find the countries whose ships had the largest number of guns. 7. Find the names of the ship with 16inch bore. 8. Find the average number of guns of battleship classes. 。 SQLFreeConnect(conn)。 SQLConnect(conn, , SQL_NTS, avi, SQL_NTS, avipasswd, SQL_NTS)。 SQLAllocConnect(env, amp。 /* database connection */ SQLAllocEnv(amp。 HENV env。 EXEC SQL execute dynprog using :account。 嵌入 SQL續(xù) ? The statement for SQLSTATE – EXEC SQL WHENEVER condition action ? Conditon – Not found no data was found ‘02021’ – Sqlerror an error occurred 舉例 ? Specify the query in SQL and declare a cursor for it EXEC SQL declare c cursor for select sname, city from S, SP where = and :amount From within a host language, find the names and cities of suppliers supply more than the variable amount quantity part. 嵌入 SQL續(xù) ? The open statement causes the query to be evaluated EXEC SQL open c The fetch statement causes the values of one tuple in the query result to be placed on host language variables. EXEC SQL fetch c into :, :cc Repeated calls to fetch get successive tuples in the query result 嵌入 SQL續(xù) ? A variable called SQLSTATE in the SQL munication area (SQLCA) gets set to ?02021? to indicate no more data is available ? The close statement causes the database system to delete the temporary relation that holds the result of the query. EXEC SQL close c Note: above details vary with language. . the Java embedding defines Java iterators to step through result tuples. 游標(biāo)更新 ? Can update tuples fetched by cursor by declaring that the cursor is for update declare c cursor for select * from EMP where city = ?Parise? for update ? To update tuple at the current location of cursor update EMP set SAL = SAL + 100 where current of c 動(dòng)態(tài) SQL ? Allows programs to construct and submit SQL queries at run time. ? The dynamic SQL program contains a ?, which is a place holder for a value that is provided when the SQL program is executed. 動(dòng)態(tài) SQL續(xù) ? Example of the use of dynamic SQL from within a C program. char * sqlprog = “update EMP set SAL = SAL *
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1