Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE users(
- userid bigint,
- username text,
- email text,
- dob text,
- loc text,
- mobile text,
- landlinenum text,
- PRIMARY KEY (userid));
- INSERT INTO users (userid,username,email,loc,mobile) VALUES (0,'mreynolds','mal@serenity.com','Minneapolis','111-555-1234');
- INSERT INTO users (userid,username,email,loc,landlinenum,dob) VALUES (1,'jcobb','jayne@serenity.com','Minneapolis','111-555-3464','19620227');
- INSERT INTO users (userid,username,email,loc,mobile) VALUES (2,'dbook','derrial@serenity.com','New York','111-555-2349');
- INSERT INTO users (userid,username,email,loc,mobile,dob) VALUES (3,'stam','simon@serenity.com','San Francisco','111-555-8899','19750416');
- INSERT INTO users (userid,username,email,loc,dob) VALUES (4,'rtam','river@serenity.com','San Francisco','19810724');
- aploetz@cqlsh:stackoverflow> SELECT * FROM users;
- userid | dob | email | landlinenum | loc | mobile | username
- --------+----------+----------------------+--------------+---------------+--------------+-----------
- 2 | null | derrial@serenity.com | null | New York | 111-555-2349 | dbook
- 3 | 19750416 | simon@serenity.com | null | San Francisco | 111-555-8899 | stam
- 4 | 19810724 | river@serenity.com | null | San Francisco | null | rtam
- 0 | null | mal@serenity.com | null | Minneapolis | 111-555-1234 | mreynolds
- 1 | 19620227 | jayne@serenity.com | 111-555-3464 | Minneapolis | null | jcobb
- (5 rows)
- aploetz@cqlsh:stackoverflow> SELECT * FROM users_by_email WHERE email='river@serenity.com';
- email | username | dob | landlinenum | loc | mobile | userid
- --------------------+----------+----------+-------------+---------------+--------+--------
- river@serenity.com | rtam | 19810724 | null | San Francisco | null | 4
- (1 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement