Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE users (
- username TEXT,
- firstname TEXT,
- lastname TEXT,
- phone TEXT,
- PRIMARY KEY (username));
- username | firstname | lastname | phone
- ------------------------------------------------
- mreynolds | Malcolm | Reynolds | 111-555-1234
- jcobb | Jayne | Cobb | 111-555-3464
- sbook | Derial | Book | 111-555-2349
- stam | Simon | Tam | 111-555-8899
- CREATE TABLE usersbyphone (
- phone TEXT,
- username TEXT,
- firstname TEXT,
- lastname TEXT,
- PRIMARY KEY (phone));
- PRIMARY KEY (phone,username));
- SELECT username, firstname, lastnamea, phone FROM usersbyphone;
- username | firstname | lastname | phone
- ------------------------------------------------
- hwashburne| Hoban | Washburne| 111-555-1212
- jcobb | Jayne | Cobb | 111-555-3464
- mreynolds | Malcolm | Reynolds | 111-555-1234
- sbook | Derial | Book | 111-555-2349
- stam | Simon | Tam | 111-555-8899
- zwashburne| Zoe | Washburne| 111-555-1212
- RowKey:mreynolds
- => (column=, value=, timestamp=1374546754299000)
- => (column=firstname, value=Malcolm, timestamp=1374546754299000)
- => (column=lastname, value=Reynolds, timestamp=1374546754299000)
- => (column=phone, value=111-555-1234, timestamp=1374546754299000)
- ------------------------------------------------------
- RowKey:hwashburne
- => (column=, value=, timestamp=1374546757815000)
- => (column=firstname, value=Hoban, timestamp=1374546757815000)
- => (column=lastname, value=Washburne, timestamp=1374546757815000)
- => (column=phone, value=111-555-1212, timestamp=1374546757815000)
- ------------------------------------------------------
- RowKey:zwashburne
- => (column=, value=, timestamp=1374546761055000)
- => (column=firstname, value=Zoe, timestamp=1374546761055000)
- => (column=lastname, value=Washburne, timestamp=1374546761055000)
- => (column=phone, value=111-555-1212, timestamp=1374546761055000)
- RowKey:111-555-1234
- => (column=mreynolds, value=, timestamp=1374546754299000)
- => (column=mreynolds:firstname, value=Malcolm, timestamp=1374546754299000)
- => (column=mreynolds:lastname, value=Reynolds, timestamp=1374546754299000)
- ------------------------------------------------------
- RowKey:111-555-1212
- => (column=hwashburne, value=, timestamp=1374546757815000)
- => (column=hwashburne:firstname, value=Hoban, timestamp=1374546757815000)
- => (column=hwashburne:lastname, value=Washburne, timestamp=1374546757815000)
- => (column=zwashburne, value=, timestamp=1374546761055000)
- => (column=zwashburne:firstname, value=Zoe, timestamp=1374546761055000)
- => (column=zwashburne:lastname, value=Washburne, timestamp=1374546761055000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement